7852 references to Path
AndroidAppBuilder (80)
AndroidLibBuilderTask.cs (3)
36var objDir = Path.Combine(OutputDir, "obj"); 66var jarFilePath = Path.Combine(OutputDir, JarFileName); 75var dexFilePath = Path.Combine(OutputDir, DexFileName);
ApkBuilder.cs (61)
62if (!string.IsNullOrEmpty(mainLibraryFileName) && !File.Exists(Path.Combine(AppDir, mainLibraryFileName))) 137string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 158var name = Path.GetFileNameWithoutExtension(obj); 165var name = Path.GetFileNameWithoutExtension(llvmObj); 182Directory.CreateDirectory(Path.Combine(OutputDir, "bin")); 183Directory.CreateDirectory(Path.Combine(OutputDir, "obj")); 184Directory.CreateDirectory(Path.Combine(OutputDir, "assets-tozip")); 185Directory.CreateDirectory(Path.Combine(OutputDir, "assets")); 196var assetsToZipDirectory = Path.Combine(OutputDir, "assets-tozip"); 200string fileName = Path.GetFileName(file); 201string extension = Path.GetExtension(file); 220File.Copy(aotlib, Path.Combine(assetsToZipDirectory, Path.GetFileName(aotlib))); 224string dx = Path.Combine(buildToolsFolder, "dx"); 225string d8 = Path.Combine(buildToolsFolder, "d8"); 226string aapt = Path.Combine(buildToolsFolder, "aapt"); 227string zipalign = Path.Combine(buildToolsFolder, "zipalign"); 228string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 229string androidJar = Path.Combine(AndroidSdk, "platforms", "android-" + BuildApiLevel, "android.jar"); 230string androidToolchain = Path.Combine(AndroidNdk, "build", "cmake", "android.toolchain.cmake"); 252monoRuntimeLib = Path.Combine(AppDir, "libmonosgen-2.0.a"); 256monoRuntimeLib = Path.Combine(AppDir, "libmonosgen-2.0.so"); 349File.WriteAllText(Path.Combine(OutputDir, "CMakeLists.txt"), cmakeLists); 350File.WriteAllText(Path.Combine(OutputDir, monodroidSource), Utils.GetEmbeddedResource(monodroidSource)); 360string javaSrcFolder = Path.Combine(OutputDir, "src", "net", "dot"); 363string javaActivityPath = Path.Combine(javaSrcFolder, "MainActivity.java"); 364string monoRunnerPath = Path.Combine(javaSrcFolder, "MonoRunner.java"); 377.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName))); 392.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName)) 398File.WriteAllText(Path.Combine(OutputDir, "AndroidManifest.xml"), 410string[] classFiles = Directory.GetFiles(Path.Combine(OutputDir, "obj"), "*.class", SearchOption.AllDirectories); 425string apkFile = Path.Combine(OutputDir, "bin", $"{ProjectName}.unaligned.apk"); 429dynamicLibs.Add(Path.Combine(OutputDir, "monodroid", "libmonodroid.so")); 437dynamicLibs.AddRange(Directory.GetFiles(AppDir, "*.so").Where(file => Path.GetFileName(file) != "libmonodroid.so")); 441Directory.CreateDirectory(Path.Combine(OutputDir, "lib", abi)); 444string dynamicLibName = Path.GetFileName(dynamicLib); 445string destRelative = Path.Combine("lib", abi, dynamicLibName); 482File.Copy(dynamicLib, Path.Combine(OutputDir, destRelative), true); 493File.Copy(dexFile, Path.Combine(OutputDir, classesFileName)); 494logger.LogMessage(MessageImportance.High, $"Adding dex file {Path.GetFileName(dexFile)} as {classesFileName}"); 500string alignedApk = Path.Combine(OutputDir, "bin", $"{ProjectName}.apk"); 520string defaultKey = Path.Combine(OutputDir, "debug.keystore"); 522defaultKey : Path.Combine(KeyStorePath, "debug.keystore"); 530else if (Path.GetFullPath(signingKey) != Path.GetFullPath(defaultKey)) 532File.Copy(signingKey, Path.Combine(OutputDir, "debug.keystore")); 552string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 553string zipalign = Path.Combine(buildToolsFolder, "zipalign"); 554string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 577string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 578string aapt = Path.Combine(buildToolsFolder, "aapt"); 579string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 583apkPath = Directory.GetFiles(Path.Combine(OutputDir, "bin"), "*.apk").First(); 585apkPath = Path.Combine(OutputDir, "bin", $"{ProjectName}.apk"); 590Utils.RunProcess(logger, aapt, $"remove -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir); 591Utils.RunProcess(logger, aapt, $"add -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir); 602string? buildTools = Directory.GetDirectories(Path.Combine(androidSdkDir, "build-tools")) 603.Select(Path.GetFileName) 605.Select(file => { Version.TryParse(Path.GetFileName(file), out Version? version); return version; }) 620return Directory.GetDirectories(Path.Combine(androidSdkDir, "platforms")) 621.Select(file => int.TryParse(Path.GetFileName(file).Replace("android-", ""), out int apiLevel) ? apiLevel : -1)
src\tasks\Common\AndroidSdkHelper.cs (8)
37_buildToolsPath = Path.Combine(_androidSdkPath, "build-tools", buildToolsVersion); 43public string AndroidJarPath => Path.Combine(_androidSdkPath, "platforms", $"android-{_buildApiLevel}", "android.jar"); 50=> Path.Combine(_buildToolsPath, tool); 57return Directory.GetDirectories(Path.Combine(androidSdkDir, "platforms")) 58.Select(file => int.TryParse(Path.GetFileName(file).Replace("android-", ""), out int apiLevel) ? apiLevel : -1) 69string? buildTools = Directory.GetDirectories(Path.Combine(androidSdkPath, "build-tools")) 70.Select(Path.GetFileName) 72.Select(file => { Version.TryParse(Path.GetFileName(file), out Version? version); return version; })
src\tasks\Common\DexBuilder.cs (1)
47sourceFileName: Path.Combine(_workingDir, "classes.dex"),
src\tasks\Common\JarBuilder.cs (1)
23.Select(classFile => Path.GetRelativePath(inputDir, classFile));
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
AppleAppBuilder (48)
AppleAppBuilder.cs (2)
235if (!File.Exists(Path.Combine(AppDir, MainLibraryFileName))) 255string binDir = Path.Combine(AppDir, $"bin-{ProjectName}-{Arch}");
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
Xcode.cs (40)
198return Path.Combine(binDir, projectName, projectName + ".xcodeproj"); 294.Where(f => !predefinedExcludes.Any(e => (!e.EndsWith('*') && f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)) || (e.EndsWith('*') && Path.GetFileName(f).StartsWith(e.TrimEnd('*'), StringComparison.InvariantCultureIgnoreCase) && 295!(!hybridGlobalization && Path.GetFileName(f) == "icudt.dat")))) 301nativeMainSource = Path.Combine(binDir, "main.m"); 306string newMainPath = Path.Combine(binDir, "main.m"); 309File.Copy(nativeMainSource, Path.Combine(binDir, "main.m"), true); 337appResources += string.Join(Environment.NewLine, resources.Where(r => !r.EndsWith("-llvm.o")).Select(r => " " + Path.GetRelativePath(binDir, r))); 361libraryPath = Path.Combine(workspace, $"{projectName}.dylib"); 365libraryPath = Path.Combine(binDir, $"lib{projectName}.dylib"); 416string libName = Path.GetFileNameWithoutExtension(lib); 418bool dylibExists = libName != "libmonosgen-2.0" && dylibs.Any(dylib => Path.GetFileName(dylib) == libName + ".dylib"); 436var name = Path.GetFileNameWithoutExtension(asm); 511File.WriteAllText(Path.Combine(binDir, "Info.plist"), plist); 517File.WriteAllText(Path.Combine(binDir, "CMakeLists.txt"), cmakeLists); 526File.WriteAllText(Path.Combine(binDir, "app.entitlements"), entitlementsTemplate.Replace("%Entitlements%", ent.ToString())); 531File.WriteAllText(Path.Combine(binDir, "runtime-librarymode.h"), Utils.GetEmbeddedResource("runtime-librarymode.h")); 532File.WriteAllText(Path.Combine(binDir, "runtime-librarymode.m"), Utils.GetEmbeddedResource("runtime-librarymode.m")); 536File.WriteAllText(Path.Combine(binDir, "runtime.h"), 543string aFileName = Path.GetFileNameWithoutExtension(aFile); 553File.WriteAllText(Path.Combine(binDir, "runtime.m"), 557.Replace("%EntryPointLibName%", Path.GetFileName(entryPointLib))); 560File.WriteAllText(Path.Combine(binDir, "util.h"), Utils.GetEmbeddedResource("util.h")); 561File.WriteAllText(Path.Combine(binDir, "util.m"), Utils.GetEmbeddedResource("util.m")); 615args.Append(" -scheme \"").Append(Path.GetFileNameWithoutExtension(xcodePrjPath)).Append('"') 618.Append(" -archivePath \"").Append(Path.GetDirectoryName(xcodePrjPath)).Append('"') 619.Append(" -derivedDataPath \"").Append(Path.GetDirectoryName(xcodePrjPath)).Append('"') 640args.Append(" -scheme \"").Append(Path.GetFileNameWithoutExtension(xcodePrjPath)).Append('"') 643.Append(" -archivePath \"").Append(Path.GetDirectoryName(xcodePrjPath)).Append('"') 644.Append(" -derivedDataPath \"").Append(Path.GetDirectoryName(xcodePrjPath)).Append('"') 653Utils.RunProcess(Logger, "xcodebuild", args.ToString(), workingDir: Path.GetDirectoryName(xcodePrjPath)); 655string appDirectory = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config + "-" + sdk); 659string appDirectoryWithoutSdk = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config); 677string filename = Path.GetFileNameWithoutExtension(appPath); 678Utils.RunProcess(Logger, "dsymutil", $"{appPath}/{filename} -o {Path.GetDirectoryName(xcodePrjPath)}/{filename}.dSYM", workingDir: Path.GetDirectoryName(appPath)); 679Utils.RunProcess(Logger, "strip", $"-no_code_signature_warning -x {appPath}/{filename}", workingDir: Path.GetDirectoryName(appPath)); 684return Path.Combine(appDirectory, Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app");
AssemblyStripper (15)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\BaseAssemblyResolver.cs (14)
72 string frameworkdir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName); 109 string file = Path.Combine (dir, name.Name + ext); 166 path = Path.Combine (path, runtime_path); 168 if (File.Exists (Path.Combine (path, "mscorlib.dll"))) 169 return AssemblyFactory.GetAssembly (Path.Combine (path, "mscorlib.dll")); 195 string[] gacPrefixes = gacPathsEnv.Split (Path.PathSeparator); 198 string gac = Path.Combine (Path.Combine (Path.Combine (gacPrefix, "lib"), "mono"), "gac"); 225 string gac = Path.Combine (Directory.GetParent (currentGac).FullName, gacs [i]); 243 return Path.Combine ( 244 Path.Combine ( 245 Path.Combine (gac, reference.Name), sb.ToString ()), 257 Path.GetDirectoryName (
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\StructureReader.cs (1)
229 m_img.FileInformation != null ? Path.Combine (m_img.FileInformation.DirectoryName, name) : name);
AutobahnTestApp (1)
Program.cs (1)
63var certPath = Path.Combine(AppContext.BaseDirectory, "TestResources", "testCert.pfx");
blazor-devserver (5)
Server\Program.cs (4)
28var applicationDirectory = Path.GetDirectoryName(applicationPath)!; 29var name = Path.ChangeExtension(applicationPath, ".staticwebassets.runtime.json"); 30name = !File.Exists(name) ? Path.ChangeExtension(applicationPath, ".StaticWebAssets.xml") : name; 42config.AddJsonFile(Path.Combine(applicationDirectory, "blazor-devserversettings.json"), optional: true, reloadOnChange: true);
Server\Startup.cs (1)
40string fileExtension = Path.GetExtension(ctx.Request.Path);
ClientSample (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
Crossgen2Tasks (49)
CommonFilePulledFromSdkRepo\RuntimeGraphCache.cs (1)
30if (!Path.IsPathRooted(runtimeJsonPath))
PrepareForReadyToRunCompilation.cs (17)
135var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath); 145outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 146outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 147crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 167outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 168outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 169crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 233MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 236compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath)); 237var compositeR2RImage = Path.Combine(OutputPath, compositeR2RImageRelativePath); 251compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb"); 252compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 257compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension); 258compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 387bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 388bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R;
ResolveReadyToRunCompilers.cs (26)
256_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 257_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 258_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 263_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 264_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 265_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 272_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 273_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 274_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 284_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 285_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 286_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 291_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 292_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 295_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 299_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 311_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 312_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 321_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 322_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 327_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 328_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 337_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 338_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 369_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 376_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
RunReadyToRunCompiler.cs (5)
232if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 324result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 329result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 391Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
CustomEncryptorSample (1)
Program.cs (1)
14var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
dotnet-dev-certs (13)
Program.cs (2)
407reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}"); 414reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}");
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
dotnet-getdocument (13)
Commands\InvokeCommand.cs (12)
43var thisPath = Path.GetFullPath(Path.GetDirectoryName(typeof(InvokeCommand).Assembly.Location)); 47var targetDirectory = Path.GetDirectoryName(assemblyPath); 60toolsDirectory = Path.Combine( 64var executableSource = Path.Combine(toolsDirectory, InsideManName + ".exe"); 65executable = Path.Combine(targetDirectory, InsideManName + ".exe"); 84toolsDirectory = Path.Combine(thisPath, $"net{targetFramework.Version}"); 88toolsDirectory = Path.Combine(thisPath, "netcoreapp2.1"); 95args.Add(Path.ChangeExtension(assemblyPath, ".deps.json")); 109args.Add(packageFolder.TrimEnd(Path.DirectorySeparatorChar)); 113var runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json"); 129args.Add(Path.Combine(toolsDirectory, InsideManName + ".dll"));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
dotnet-openapi (13)
Commands\BaseCommand.cs (12)
137return File.Exists(Path.GetFullPath(file)) && file.EndsWith(".csproj", StringComparison.Ordinal); 277var directory = Path.GetDirectoryName(fullPath); 278destinationPath = GetUniqueFileName(directory, Path.GetFileNameWithoutExtension(fileName), Path.GetExtension(fileName)); 344var filePath = Path.Combine(directory, fileName + extension); 358filePath = Path.Combine(directory, uniqueName + extension); 372var fileName = Path.GetFileName(contentDisposition.FileName); 373if (!Path.HasExtension(fileName)) 386if (!Path.HasExtension(lastSegment)) 439return Path.IsPathFullyQualified(path) 441: Path.GetFullPath(path, WorkingDirectory); 551var destinationDirectory = Path.GetDirectoryName(destinationPath);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
dotnet-razorpagegenerator (4)
Program.cs (4)
63@class.ClassName = Path.GetFileNameWithoutExtension(document.Source.FilePath); 134var generatedCodeFilePath = Path.ChangeExtension(projectItem.PhysicalPath, ".Designer.cs"); 194var basePath = System.IO.Path.GetDirectoryName(_source.PhysicalPath); 214var includeFileContent = File.ReadAllText(System.IO.Path.Combine(basePath, includeFileName));
dotnet-sql-cache (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
dotnet-user-jwts (24)
Commands\ClearCommand.cs (2)
57var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json");
Commands\CreateCommand.cs (2)
247var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json");
Commands\RemoveCommand.cs (2)
46var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json");
Helpers\DevJwtCliHelpers.cs (2)
52var launchSettingsFilePath = Path.Combine(Path.GetDirectoryName(project)!, "Properties", "launchSettings.json");
Helpers\JwtStore.cs (3)
17_filePath = Path.Combine(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId)), FileName); 48var tempFilename = Path.GetTempFileName();
Helpers\SigningKeysHandler.cs (1)
63Directory.CreateDirectory(Path.GetDirectoryName(secretsFilePath));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (15)
Internal\SecretsStore.cs (3)
33var secretDir = Path.GetDirectoryName(_secretsFilePath); 71Directory.CreateDirectory(Path.GetDirectoryName(_secretsFilePath)); 85var tempFilename = Path.GetTempFileName();
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
FilesWebSite (10)
Controllers\DownloadFilesController.cs (10)
18_testFilesPath = Path.Combine(Path.GetTempPath(), "test-files"); 23var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 29var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 37var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 43var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 51var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 52var symlink = Path.Combine(_testFilesPath, Path.GetRandomFileName()); 120Directory.Delete(Path.Combine(_testFilesPath), recursive: true);
GetDocument.Insider (6)
Commands\GetDocumentCommand.cs (3)
55.Except(new[] { Path.GetFullPath(thisAssembly.Location) }) 56.ToDictionary(Path.GetFileNameWithoutExtension, path => new AssemblyInfo(path)); 128AssemblyName = Path.GetFileNameWithoutExtension(assemblyPath),
Commands\GetDocumentCommandWorker.cs (2)
30private static readonly char[] InvalidFilenameCharacters = Path.GetInvalidFileNameChars(); 353path = Path.Combine(outputDirectory, path);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
HelixTestRunner (23)
ProcessUtil.cs (6)
33var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}-{process.Id}.dmp"); 48var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}.{process.Id}.dmp"); 108process.StartInfo.EnvironmentVariables["COMPlus_DbgMiniDumpName"] = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.%d.dmp"); 181var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.{process.Id}.dmp");
TestRunner.cs (17)
36var nugetRestore = Path.Combine(helixDir, "nugetRestore"); 38var dotnetEFFullPath = Path.Combine(nugetRestore, helixDir, "dotnet-ef.exe"); 67DisplayContents(Path.Combine(Options.DotnetRoot, "host", "fxr")); 68DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.NETCore.App")); 69DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.AspNetCore.App")); 70DisplayContents(Path.Combine(Options.DotnetRoot, "packs", "Microsoft.AspNetCore.App.Ref")); 89ProcessUtil.PrintMessage(Path.GetFileName(file)); 93ProcessUtil.PrintMessage(Path.GetFileName(file)); 231var diagLog = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"), "vstest.log"); 315var logName = $"{Path.GetFileName(Path.GetDirectoryName(file))}_{Path.GetFileName(file)}"; 316ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName)}"); 317File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName)); 329var fileName = Path.GetFileName(file); 330ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName)}"); 331File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName));
HttpClientApp (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
HttpStress (4)
Program.cs (4)
374Console.WriteLine(" .NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(object).Assembly.Location))); 375Console.WriteLine(" ASP.NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(IWebHostBuilder).Assembly.Location)));
Identity.ExternalClaims (1)
Pages\Account\Manage\ManageNavPages.cs (1)
33?? System.IO.Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
IIS.FunctionalTests (38)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
62var temporaryFile = Path.GetTempFileName(); 71var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 216file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 222return Path.Combine(deploymentResult.ContentRoot, 245var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 246var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 266var destFileName = Path.Combine(target.FullName, fileInfo.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
93WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 120AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 134AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 150AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 158var firstTempFile = Path.GetTempFileName(); 159var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
146return Path.Combine(siteRoot, "web.config");
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (3)
52(args, contentRoot) => $"{args} CreateFile \"{Path.Combine(contentRoot, "Started.txt")}\""); 58await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue); 102await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue);
IIS.LongTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
107using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 125using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 179File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
115deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 210deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 214Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 215Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 216Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 281Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 282Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 346File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 406File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 447File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.Microbenchmarks (1)
StartupTimeBenchmark.cs (1)
26var deploymentParameters = new DeploymentParameters(Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS/test/testassets/InProcessWebSite"),
IIS.NewHandler.FunctionalTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
107using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 125using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 179File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
115deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 210deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 214Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 215Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 216Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 281Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 282Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 346File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 406File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 447File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.NewShim.FunctionalTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
107using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 125using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 179File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
115deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 210deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 214Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 215Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 216Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 281Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 282Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 346File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 406File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 447File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.ShadowCopy.Tests (47)
ShadowCopyTests.cs (26)
46var directoryName = Path.GetRandomFileName(); 63var tempDirectoryPath = Path.Combine(deploymentResult.ContentRoot, directoryName); 150var deleteDirPath = Path.Combine(deploymentResult.ContentRoot, "wwwroot/deletethis"); 152File.WriteAllText(Path.Combine(deleteDirPath, "file.dll"), ""); 181DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 208DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true); 220Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped"); 231Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "2")), "Expected 2 shadow copy directory"); 247DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true); 248DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "3"), copySubDirs: true); 249DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "10"), copySubDirs: true); 261Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped"); 272Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "11")), "Expected 11 shadow copy directory"); 278Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "1")), "Expected 1 shadow copy directory to be deleted"); 279Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "3")), "Expected 3 shadow copy directory to be deleted"); 291DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 304Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy"))); 306Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy"))); 321DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 334Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy"))); 336Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy"))); 346var directoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 414string tempPath = Path.Combine(destDirName, file.Name); 427string tempPath = Path.Combine(destDirName, subdir.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
IIS.Tests (5)
Utilities\TestServer.cs (5)
33internal static string BasePath => Path.Combine(Path.GetDirectoryName(typeof(TestServer).Assembly.Location), 37internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll); 99_appHostConfigPath = Path.GetTempFileName(); 125var webHostConfig = XDocument.Load(Path.GetFullPath("HostableWebCore.config"));
IISExpress.FunctionalTests (57)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
62var temporaryFile = Path.GetTempFileName(); 71var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 216file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 222return Path.Combine(deploymentResult.ContentRoot, 245var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 246var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 266var destFileName = Path.Combine(target.FullName, fileInfo.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
93WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 120AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 134AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 150AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 158var firstTempFile = Path.GetTempFileName(); 159var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
146return Path.Combine(siteRoot, "web.config");
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
107using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 125using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 179File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
115deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 210deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 214Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 215Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 216Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 281Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 282Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 346File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 406File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 447File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
illink (26)
ILLink.Tasks (6)
LinkTask.cs (6)
250 protected override string ToolName => Path.GetFileName (DotNetPath); 262 var taskDirectory = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location); 265 _illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net9.0", "illink.dll"); 341 var assemblyName = Path.GetFileNameWithoutExtension (assemblyPath); 394 var assemblyName = Path.GetFileNameWithoutExtension (assemblyPath);
InMemory.FunctionalTests (5)
HttpsConnectionMiddlewareTests.cs (2)
75["Certificates:Default:Path"] = Path.Combine("shared", "TestCertificates", "https-aspnet.crt"), 76["Certificates:Default:KeyPath"] = Path.Combine("shared", "TestCertificates", "https-aspnet.key"),
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (2)
187File.WriteAllText(System.IO.Path.Combine(hostingEnv.ContentRootPath, "Started.txt"), ""); 956var tempFile = System.IO.Path.GetTempFileName();
installer.tasks (10)
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateFileVersionProps.cs (3)
59var fileName = Path.GetFileName(file.ItemSpec); 131var manifestFileName = Path.GetFileName(PlatformManifestFile); 135Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestFile));
GenerateRunScript.cs (3)
41Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 45string extension = Path.GetExtension(Path.GetFileName(OutputPath)).ToLowerInvariant();
GenerateTestSharedFrameworkDepsFile.cs (3)
54.Where(file => !ignoredExtensions.Contains(Path.GetExtension(file))) 55.ToLookup(file => IsManagedAssembly(file), file => Path.GetFileName(file)); 85using (var depsFileStream = File.Create(Path.Combine(SharedFrameworkDirectory, $"{sharedFxName}.deps.json")))
Interop.FunctionalTests (13)
H2SpecCommands.cs (5)
54var root = Path.Combine(Environment.CurrentDirectory, "h2spec"); 57return Path.Combine(root, "windows", "h2spec.exe"); 61var toolPath = Path.Combine(root, "linux", "h2spec"); 67var toolPath = Path.Combine(root, "darwin", "h2spec"); 217var tempFile = Path.GetTempPath() + Guid.NewGuid() + ".xml";
Http3\Http3TlsTests.cs (5)
411new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 436Directory.CreateDirectory(Path.GetDirectoryName(path)); 511var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 512basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 513return Path.Combine(basePath, $"{typeof(Http3TlsTests).Assembly.GetName().Name}.pfx");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InteropTests (2)
InteropTests.cs (2)
15private readonly string _clientPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropClient", "InteropClient.dll"); 16private readonly string _serverPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropWebsite", "InteropWebsite.dll");
InteropWebsite (2)
Program.cs (2)
57var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); 58var certPath = Path.Combine(basePath!, "Certs", "server1.pfx");
KeyManagementSample (1)
Program.cs (1)
15var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
LibraryBuilder (14)
LibraryBuilder.cs (8)
118get => Path.Combine(OutputDirectory, "mobile_symbols.txt"); 140File.WriteAllText(Path.Combine(OutputDirectory, "library-builder.h"), 195exportedAssemblies.Add(Path.GetFileName(compiledAssembly.Path)); 202string ext = Path.GetExtension(lib.ItemSpec); 313File.WriteAllText(Path.Combine(OutputDirectory, "autoinit.c"), autoInitialization); 324File.WriteAllText(Path.Combine(OutputDirectory, "preloaded-assemblies.c"), 363return Path.Combine(OutputDirectory, libraryName); 410return Path.Combine(OutputDirectory, libraryName);
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
Microsoft.Arcade.Common (11)
CommandFactory.cs (4)
56var extension = Path.GetExtension(executable); 61else if (executable.Contains(Path.DirectorySeparatorChar)) 73foreach (var path in System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 75var candidate = Path.Combine(path, executable + ".exe");
FileSystem.cs (6)
20public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 22public string? GetFileName(string? path) => Path.GetFileName(path); 24public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 26public string? GetExtension(string? path) => Path.GetExtension(path); 28public string PathCombine(string path1, string path2) => Path.Combine(path1, path2); 32string? dirPath = Path.GetDirectoryName(path);
ZipArchiveManager.cs (1)
30string entryName = Path.GetFileName(filePath);
Microsoft.Arcade.Test.Common (4)
MockFileSystem.cs (4)
45public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 47public string? GetFileName(string? path) => Path.GetFileName(path); 49public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 51public string? GetExtension(string? path) => Path.GetExtension(path);
Microsoft.AspNetCore (8)
HostingPathResolver.cs (8)
15Path.EndsInDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 21return Path.GetFullPath(basePath); 23if (Path.IsPathRooted(contentRootPath)) 25return Path.GetFullPath(contentRootPath); 27return Path.GetFullPath(Path.Combine(Path.GetFullPath(basePath), contentRootPath));
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticVerifier.cs (4)
194var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 201dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Microsoft.AspNetCore.App.Analyzers.Test (5)
TestDiagnosticAnalyzer.cs (2)
157if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Verifiers\CSharpAnalyzerVerifier.cs (3)
52Path.Combine( 55Path.Combine(TestData.GetRepoRoot(), "NuGet.config"); 61Path.Combine("ref", "net9.0"))
Microsoft.AspNetCore.App.UnitTests (36)
PackageTests.cs (6)
35Path.Combine( 53var outputPath = Path.Combine(_packageLayoutRoot, Path.GetFileNameWithoutExtension(package)); 88var packageAssembliesDir = Path.Combine(packageDir, "lib"); 119var packageToolsDir = Path.Combine(packageDir, "tools"); 123.Where(f => !toolAssembliesToSkip.Any(s => Path.GetFileNameWithoutExtension(f).Contains(s, StringComparison.OrdinalIgnoreCase)));
SharedFxTests.cs (9)
27_sharedFxRoot = Path.Combine( 38.Select(Path.GetFileNameWithoutExtension) 62.Select(Path.GetFileNameWithoutExtension) 88var runtimeConfigFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.json"); 91AssertEx.FileDoesNotExists(Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.dev.json")); 105var depsFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.deps.json"); 178var name = Path.GetFileNameWithoutExtension(path); 229if (!repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path))) 250var versionFile = Path.Combine(_sharedFxRoot, ".version");
TargetingPackTests.cs (21)
28_targetingPackRoot = Path.Combine( 38var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll") 39.Select(Path.GetFileNameWithoutExtension) 73IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); 78var expectedVersion = repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path)) ? 82var fileName = Path.GetFileNameWithoutExtension(path); 90if (repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path))) 113IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); 127Assert.True(result, $"In {Path.GetFileName(path)}, {reference.GetAssemblyName()} has unexpected version {reference.Version}."); 135var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt"); 194IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories); 226var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt"); 231var fileName = Path.GetFileName(i); 291var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 304var analyzersDir = Path.Combine(_targetingPackRoot, "analyzers"); 307.Select(p => Path.GetFileNameWithoutExtension(p)) 358var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 368var targetingPackPath = Path.Combine( 400var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 414string expectedLanguage = Path.GetFileName(Path.GetDirectoryName(assemblyPath));
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (74)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
UserJwtsTestFixture.cs (8)
64var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest", Guid.NewGuid().ToString())); 65Directory.CreateDirectory(Path.Combine(projectPath.FullName, "Properties")); 70Directory.CreateDirectory(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId))); 74Path.Combine(projectPath.FullName, "TestProject.csproj"), 77File.WriteAllText(Path.Combine(projectPath.FullName, "Properties", "launchSettings.json"), 81Path.Combine(projectPath.FullName, "appsettings.Development.json"), 90var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId));
UserJwtsTests.cs (59)
22var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 32var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 43var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 56var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 57var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 68var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 69var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 85var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 95var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 109var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 130var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 142var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 143var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 160var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 161var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 178var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 192var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 220var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 232var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 246var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 261var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 275var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 288var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 307var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 327var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 348var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 370var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 385var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 399var project = Path.Combine(projectPath, "TestProject.csproj"); 401var launchSettingsPath = Path.Combine(projectPath, "Properties", "launchSettings.json"); 415var project = Path.Combine(projectPath, "TestProject.csproj"); 442var project = Path.Combine(projectPath, "TestProject.csproj"); 470var project = Path.Combine(projectPath, "TestProject.csproj"); 487var project = Path.Combine(projectPath, "TestProject.csproj"); 508var project = Path.Combine(projectPath, "TestProject.csproj"); 530var project = Path.Combine(projectPath, "TestProject.csproj"); 555var project = Path.Combine(projectPath, "TestProject.csproj"); 581var project = Path.Combine(projectPath, "TestProject.csproj"); 618var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 631var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 643var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 655var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 668var project = Path.Combine(projectPath, "TestProject.csproj"); 673Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 680var tempPath = Path.GetTempPath(); 681var targetPath = Path.GetRelativePath(tempPath, projectPath); 682var project = Path.Combine(projectPath, "TestProject.csproj"); 689Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 696var tempPath = Path.GetTempPath(); 697var targetPath = Path.GetRelativePath(tempPath, projectPath); 711var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj");
Microsoft.AspNetCore.BrowserTesting (11)
BrowserManagerConfiguration.cs (4)
76BaseArtifactsFolder = Path.GetFullPath(configuration.GetValue(nameof(BaseArtifactsFolder), Path.Combine(Directory.GetCurrentDirectory(), "playwright"))); 182if (Path.IsPathRooted(folderPath)) 189folderPath = Path.Combine(BaseArtifactsFolder, folderPath);
BrowserTestBase.cs (6)
39var basePath = Path.GetDirectoryName(typeof(BrowserTestBase).Assembly.Location); 49.AddJsonFile(Path.Combine(basePath, "playwrightSettings.json")) 50.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.{os}.json"), optional: true); 54builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.ci.json"), optional: true) 55.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.ci.{os}.json"), optional: true); 60builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.debug.json"), optional: true);
ContextInformation.cs (1)
58browserContextOptions.RecordHarPath = Path.Combine(
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.WebAssembly (2)
Services\LazyAssemblyLoader.cs (2)
56loadedAssemblies.Add(Assembly.Load(Path.GetFileNameWithoutExtension(assemblyName))); 88var assemblyName = Path.GetFileNameWithoutExtension(newAssembliesToLoad[i]);
Microsoft.AspNetCore.Components.WebAssembly.Server (9)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
109var fileExtension = Path.GetExtension(requestPath.Value); 119var originalPath = Path.GetFileNameWithoutExtension(requestPath.Value);
DebugProxyLauncher.cs (2)
125var debugProxyPath = Path.Combine( 126Path.GetDirectoryName(assembly.Location)!,
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
TargetPickerUi.cs (4)
376var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug"); 402var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
Microsoft.AspNetCore.Components.WebView (3)
WebViewManager.cs (3)
304var name = Path.GetFileNameWithoutExtension(assembly.Location); 306return Path.Combine(Path.GetDirectoryName(assembly.Location)!, $"{name}.staticwebassets.runtime.json");
Microsoft.AspNetCore.Components.WebView.Photino (3)
BlazorWindow.cs (3)
47var contentRootDir = Path.GetDirectoryName(Path.GetFullPath(hostPage))!; 48var hostPageRelativePath = Path.GetRelativePath(contentRootDir, hostPage);
Microsoft.AspNetCore.Components.WebView.Test (1)
StaticContentProviderTests.cs (1)
119public string Name => Path.GetFileName(_filePath);
Microsoft.AspNetCore.Components.WebViewE2E.Test (3)
BasicBlazorHybridTest.cs (2)
23var thisProgramDir = Path.GetDirectoryName(typeof(Program).Assembly.Location); 26var newNativePath = Path.Combine(thisProgramDir, "runtimes", RuntimeInformation.RuntimeIdentifier, "native");
WebViewManagerE2ETests.cs (1)
32WorkingDirectory = Path.GetDirectoryName(photinoTestProgramExePath),
Microsoft.AspNetCore.DataProtection (10)
Internal\ContainerUtils.cs (2)
65var fs_file = new DirectoryInfo(fields[1].TrimEnd(Path.DirectorySeparatorChar)).FullName; 70if (fs_file.Equals(dir.FullName.TrimEnd(Path.DirectorySeparatorChar), StringComparison.Ordinal))
Internal\HostingApplicationDiscriminator.cs (2)
14private readonly string DirectorySeparator = Path.DirectorySeparatorChar.ToString(); 15private readonly string AltDirectorySeparator = Path.AltDirectorySeparatorChar.ToString();
Repositories\DefaultKeyStorageDirectories.cs (3)
55retVal = GetKeyStorageDirectoryFromBaseAppDataPath(Path.Combine(homePath, "AppData", "Local")); 60retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName)); 110return new DirectoryInfo(Path.Combine(basePath, "ASP.NET", DataProtectionKeysFolderName));
Repositories\FileSystemXmlRepository.cs (3)
134var tempFilename = Path.Combine(Directory.FullName, Guid.NewGuid().ToString() + ".tmp"); 135var finalFilename = Path.Combine(Directory.FullName, filename + ".xml"); 140var tempTempFilename = Path.GetTempFileName();
Microsoft.AspNetCore.DataProtection.Extensions.Tests (12)
DataProtectionProviderTests.cs (12)
51var keysPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 121var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx"); 148var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCertWithoutPrivateKey.pfx"), "password"); 176var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3WithoutPrivateKey.pfx"), "password3", X509KeyStorageFlags.Exportable); 193var certWithKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3.pfx"), "password3"); 216var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 245var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 287var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 323string uniqueTempPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 340=> Path.Combine(AppContext.BaseDirectory, "TestFiles");
Microsoft.AspNetCore.DataProtection.Tests (12)
Repositories\FileSystemXmlRepositoryTests.cs (5)
19? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET") 20: Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet"); 21var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName; 182string uniqueTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
XmlEncryption\EncryptedXmlDecryptorTests.cs (7)
18var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 32var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 33var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password"); 50var fullCert = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 51var publicKeyOnly = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.PublicKeyOnly.cer"), ""); 68var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 69var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (10)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (2)
CertificateManagerTests.cs (2)
185var exportedCertificate = X509Certificate2.CreateFromEncryptedPemFile(CertificateName, certificatePassword, Path.ChangeExtension(CertificateName, "key")); 306var exportedCertificate = X509Certificate2.CreateFromPemFile(CertificateName, Path.ChangeExtension(CertificateName, "key"));
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
402Write(System.IO.Path.GetFileName(firstFrame.File)); 650Write(System.IO.Path.GetFileName(frame.File));
Microsoft.AspNetCore.Diagnostics.Tests (2)
ExceptionDetailsProviderTest.cs (2)
41Path.Combine(rootPath, "TestFiles/SourceFile.txt") 46Path.Combine(rootPath, @"TestFiles\SourceFile.txt");
Microsoft.AspNetCore.FunctionalTests (18)
WebApplicationFunctionalTests.cs (13)
16var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 21await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @" 59var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 64await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.Development.json"), @" 102var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 107await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @" 143await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @"
WebHostFunctionalTests.cs (5)
154var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) 209var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitectures.Current) 240var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "DefaultBuilder.slnf")); 243return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "testassets"));
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Infrastructure\OpenApiTestHelpers.cs (1)
24var filePath = Path.Combine(System.AppContext.BaseDirectory, "Microsoft.AspNetCore.Grpc.Swagger.Tests.xml");
Microsoft.AspNetCore.Hosting (13)
Internal\HostingEnvironmentExtensions.cs (6)
30var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 38hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 43hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath); 81var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 89hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 94hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath);
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StaticWebAssets\StaticWebAssetsLoader.cs (2)
77var basePath = string.IsNullOrEmpty(assemblyLocation) ? AppContext.BaseDirectory : Path.GetDirectoryName(assemblyLocation); 78return Path.Combine(basePath!, $"{environment.ApplicationName}.staticwebassets.runtime.json");
WebHostBuilder.cs (3)
368if (Path.IsPathRooted(contentRootPath)) 372return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
Microsoft.AspNetCore.Hosting.FunctionalTests (3)
LinkedApplicationTests.cs (1)
21var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
ShutdownTests.cs (1)
47var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
WebHostBuilderTests.cs (1)
28var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets", "IStartupInjectionAssemblyName");
Microsoft.AspNetCore.Hosting.Tests (27)
HostingApplicationDiagnosticsTests.cs (2)
685var testSource = new ActivitySource(Path.GetRandomFileName()); 757var testSource = new ActivitySource(Path.GetRandomFileName());
HostingApplicationTests.cs (4)
95var testSource = new ActivitySource(Path.GetRandomFileName()); 96var dummySource = new ActivitySource(Path.GetRandomFileName()); 137var testSource = new ActivitySource(Path.GetRandomFileName()); 138var dummySource = new ActivitySource(Path.GetRandomFileName());
HostingEnvironmentExtensionsTests.cs (12)
24env.Initialize(Path.GetFullPath("."), webHostOptions); 26Assert.Equal(Path.GetFullPath("."), env.ContentRootPath); 27Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath); 37env.Initialize(Path.GetFullPath("testroot"), CreateWebHostOptions()); 39Assert.Equal(Path.GetFullPath("testroot"), env.ContentRootPath); 40Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.WebRootPath); 50env.Initialize(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), CreateWebHostOptions()); 52Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.ContentRootPath); 71env.Initialize(Path.GetFullPath("."), webHostOptions);
StaticWebAssets\ManifestStaticWebAssetsFileProviderTests.cs (3)
20manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) }; 368manifest.ContentRoots = new[] { Path.Combine(AppContext.BaseDirectory, "testroot", "wwwroot") }; 616manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) };
WebHostBuilderTests.cs (4)
683Assert.True(Path.IsPathRooted(basePath)); 684Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath); 686Assert.True(Path.IsPathRooted(basePath2)); 687Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath2);
WebHostTests.cs (2)
848Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath); 854Assert.Equal(Path.GetFullPath("testroot"), env1.WebRootPath);
Microsoft.AspNetCore.Http (2)
BindingAddress.cs (1)
246if (isUnixPipe && !Path.IsPathRooted(GetUnixPipePath(host)))
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
EndpointFilterInvocationContextOfTTests.cs (2)
87var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.cs"); 88var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.tt");
Microsoft.AspNetCore.Http.Extensions.Tests (9)
RequestDelegateGenerator\CompileTimeCreationTests.cs (2)
155var mappedDirectory = Path.Combine(currentDirectory, "path", "mapped"); 163project = project.AddDocument("TestMapActions.cs", SourceText.From(source, Encoding.UTF8), filePath: Path.Combine(currentDirectory, "TestMapActions.cs")).Project;
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
120var symbolsName = Path.ChangeExtension(assemblyName, "pdb"); 356? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "RequestDelegateGenerator", "Baselines") 358var baselineFilePath = Path.Combine(baselineFilePathRoot!, $"{callerName}.generated.txt"); 421var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 429dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Http.Microbenchmarks (7)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
120var symbolsName = Path.ChangeExtension(assemblyName, "pdb"); 356? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "RequestDelegateGenerator", "Baselines") 358var baselineFilePath = Path.Combine(baselineFilePathRoot!, $"{callerName}.generated.txt"); 421var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 429dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
143if (!Path.IsPathRooted(fileName))
Results.cs (1)
484=> Path.IsPathRooted(path)
Microsoft.AspNetCore.Http.Results.Tests (59)
ResultsCacheTests.cs (2)
13var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.cs"); 14var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.tt");
ResultsOfTTests.cs (4)
27var resultsOfTGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfT.Generated.cs"); 28var testsGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfTTests.Generated.cs"); 30var testResultsOfTGeneratedPath = Path.GetTempFileName(); 31var testTestsGeneratedPath = Path.GetTempFileName();
ResultsTests.cs (2)
1675(() => Results.File(Path.Join(Path.DirectorySeparatorChar.ToString(), "rooted", "path"), null, null, null, null, false), typeof(PhysicalFileHttpResult)),
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt")); 337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name); 347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")); 357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
Microsoft.AspNetCore.HttpLogging (4)
FileLoggerProcessor.cs (4)
53_path = Path.Join(environment.ContentRootPath, "logs"); 55else if (!Path.IsPathRooted(_path)) 57_path = Path.Join(environment.ContentRootPath, _path); 329return Path.Combine(_path, FormattableString.Invariant($"{_fileName}{date.Year:0000}{date.Month:00}{date.Day:00}.{_fileNumber:0000}.txt"));
Microsoft.AspNetCore.HttpLogging.Tests (23)
FileLoggerProcessorTests.cs (21)
22TempPath = Path.Combine(Environment.CurrentDirectory, "_"); 34var path = Path.Combine(TempPath, Path.GetRandomFileName()); 70var path = Path.Combine(TempPath, Path.GetRandomFileName()); 112var path = Path.Combine(TempPath, Path.GetRandomFileName()); 152var path = Path.Combine(TempPath, Path.GetRandomFileName()); 154File.WriteAllText(Path.Combine(path, "randomFile.txt"), "Text"); 207var path = Path.Combine(TempPath, Path.GetRandomFileName()); 272var path = Path.Combine(TempPath, Path.GetRandomFileName()); 358var path = Path.Combine(TempPath, Path.GetRandomFileName()); 421var path = Path.Combine(TempPath, Path.GetRandomFileName()); 490var path = Path.Combine(TempPath, Path.GetRandomFileName()); 589return Path.Combine(path, GetLogFileName(prefix, dateTime, fileNumber));
W3CLoggerTests.cs (2)
16var path = Path.GetTempFileName() + "_"; 59var path = Path.GetTempFileName() + "_";
Microsoft.AspNetCore.Identity.Test (6)
IdentityUIScriptsTest.cs (6)
79var wwwrootDir = Path.Combine(GetProjectBasePath(), "assets", scriptTag.Version); 82Path.Combine(wwwrootDir, scriptTag.FallbackSrc.Replace("Identity", "").TrimStart('~').TrimStart('/'))); 104var uiDirV4 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V4"); 105var uiDirV5 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V5"); 161return Directory.Exists(projectPath) ? projectPath : Path.Combine(FindHelixSlnFileDirectory(), "UI"); 166var applicationPath = Path.GetDirectoryName(typeof(IdentityUIScriptsTest).Assembly.Location);
Microsoft.AspNetCore.Identity.UI (4)
Areas\Identity\Pages\V4\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Areas\Identity\Pages\V5\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Microsoft.AspNetCore.InternalTesting (16)
AssemblyTestLog.cs (5)
120logOutputDirectory = Path.Combine(_baseDirectory, className); 140var testOutputFile = Path.Combine(logOutputDirectory, $"{testName}{LogFileExtension}"); 148testOutputFile = Path.Combine(logOutputDirectory, $"{testName}.{i}{LogFileExtension}"); 191var globalLogFileName = Path.Combine(baseDirectory, "global.log"); 274var dir = Path.GetDirectoryName(fileName);
CollectDumpAttribute.cs (1)
30var path = Path.Combine(context.FileOutput.TestClassOutputDirectory, context.FileOutput.GetUniqueFileName(context.FileOutput.TestName, ".dmp"));
HelixHelper.cs (3)
20? Path.Combine(Path.GetTempPath(), uploadFileName) 21: Path.Combine(uploadRoot, uploadFileName);
TestFileOutputContext.cs (4)
43TestClassOutputDirectory = Path.Combine(AssemblyOutputDirectory, TestClassName); 64var path = Path.Combine(TestClassOutputDirectory, $"{prefix}{extension}"); 69path = Path.Combine(TestClassOutputDirectory, $"{prefix}{i++}{extension}"); 91return Path.Combine(baseDirectory, assembly.GetName().Name, attribute.TargetFramework);
TestPathUtilities.cs (3)
19var projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, $"{solution}.slnf")); 25projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "AspNetCore.sln")); 29directoryInfo = new DirectoryInfo(Path.Combine(directoryInfo.FullName, "src"));
Microsoft.AspNetCore.InternalTesting.Tests (16)
AssemblyTestLogTests.cs (15)
47var tfmPath = Path.Combine(tempDir, assemblyName, TestableAssembly.TFM); 48var globalLogPath = Path.Combine(tfmPath, "global.log"); 49var testLog = Path.Combine(tfmPath, TestableAssembly.TestClassName, $"{testName}.log"); 148var globalLogPath = Path.Combine( 153var testLog = Path.Combine( 184var globalLogPath = Path.Combine( 189var testLog = Path.Combine( 230var globalLogPath = Path.Combine( 235var testLog = Path.Combine( 298Path.Combine(tempDir, TestableAssembly.ThisAssemblyName, TestableAssembly.TFM, "FakeTestClass")) 301var testFileName = Path.GetFileNameWithoutExtension(testLog.Name); 343Assert.True(File.Exists(Path.Combine( 353Assert.True(File.Exists(Path.Combine( 368var tempDir = Path.Combine(Path.GetTempPath(), $"TestLogging_{Guid.NewGuid():N}");
TestableAspNetTestAssemblyRunner.cs (1)
54.Returns(Path.Combine(Directory.GetCurrentDirectory(), $"{testAssemblyName}.dll"));
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
72Path.GetDirectoryName(assembly.Location); 90var relatedAssemblyLocation = Path.Combine(assemblyDirectory, attribute.AssemblyFileName + ".dll");
Infrastructure\PhysicalFileResultExecutor.cs (1)
79if (!Path.IsPathRooted(result.FileName))
Microsoft.AspNetCore.Mvc.Core.Test (62)
ApplicationParts\RelatedAssemblyPartTest.cs (5)
12private static readonly string AssemblyDirectory = Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar); 44var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 59var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 89public string LocationSettable { get; set; } = Path.Combine(AssemblyDirectory, "MyAssembly.dll");
ControllerBaseTest.cs (4)
1773var path = Path.GetFullPath("somepath"); 1795var path = Path.GetFullPath("somepath"); 1817var path = Path.GetFullPath("somepath"); 1839var path = Path.GetFullPath("somepath");
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt")); 337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name); 347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")); 357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
VirtualFileResultTest.cs (2)
23var path = Path.GetFullPath("helllo.txt"); 36var path = Path.GetFullPath("helllo.txt");
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
Infrastructure\ResourceFile.cs (2)
228var projectPath = Path.Combine(solutionPath, "test", assembly.GetName().Name); 229var fullPath = Path.Combine(projectPath, resourceName);
SimpleWithWebApplicationBuilderTests.cs (2)
203expectedWebRoot = Path.GetFullPath(Path.Combine(builder.GetSetting(WebHostDefaults.ContentRootKey), webRoot));
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
97var extension = Path.GetExtension(path);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
FileProviderRazorProjectFileSystem.cs (1)
62else if (string.Equals(RazorFileExtension, Path.GetExtension(fileInfo.Name), StringComparison.OrdinalIgnoreCase))
FileProviderRazorProjectItem.cs (2)
81(PhysicalPath[_root.Length] == Path.DirectorySeparatorChar || PhysicalPath[_root.Length] == Path.AltDirectorySeparatorChar))
RuntimeViewCompiler.cs (1)
339var assemblyName = Path.GetRandomFileName();
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (18)
AssemblyPartExtensionTest.cs (1)
25references.Select(Path.GetFileNameWithoutExtension));
FileProviderRazorProjectFileSystemTest.cs (17)
53Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath); 60Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), file.PhysicalPath); 89var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content"); 104Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath); 111Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath); 112Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath); 118Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath); 119Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath); 125Assert.Equal(Path.Combine("BasePath", "Level1-Dir2", "File5.cshtml"), file.PhysicalPath); 126Assert.Equal(Path.Combine("Level1-Dir2", "File5.cshtml"), file.RelativePhysicalPath); 154var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content"); 169Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath); 170Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath); 176Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath); 177Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath); 199Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), item.PhysicalPath); 221Assert.Equal(Path.Combine("BasePath2", "File3.cshtml"), item.PhysicalPath);
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
PageModelTest.cs (2)
1410var path = Path.GetFullPath("somepath"); 1427var path = Path.GetFullPath("somepath");
PageTest.cs (2)
1400var path = Path.GetFullPath("somepath"); 1417var path = Path.GetFullPath("somepath");
Microsoft.AspNetCore.Mvc.Testing (5)
WebApplicationFactory.cs (5)
261var contentRootCandidate = Path.Combine( 265var contentRootMarker = Path.Combine( 267Path.GetFileName(contentRootAttribute.ContentRootTest)); 370var depsFile = new FileInfo(Path.Combine(AppContext.BaseDirectory, depsFileName)); 375Path.GetFileName(depsFile.FullName)));
Microsoft.AspNetCore.Mvc.Views.TestCommon (5)
TestFileProvider.cs (5)
44PhysicalPath = Path.Combine(Root, NormalizeAndEnsureValidPhysicalPath(path)), 45Name = Path.GetFileName(path), 56var directoryContent = new TestDirectoryContent(Path.GetFileName(path), files); 114filePath = filePath.Replace('/', Path.DirectorySeparatorChar); 116if (filePath[0] == Path.DirectorySeparatorChar)
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\OpenApiDocumentIntegrationTests.cs (1)
25? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots")
Microsoft.AspNetCore.OutputCaching.Tests (1)
TestUtils.cs (1)
57var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
Microsoft.AspNetCore.ResponseCaching.Tests (1)
TestUtils.cs (1)
82var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (6)
ResponseCachingTests.cs (1)
25_absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Microsoft.AspNetCore.Server.HttpSys.dll");
ResponseSendFileTests.cs (2)
31RelativeFilePath = Path.GetFileName(AbsoluteFilePath); 307var emptyFilePath = Path.Combine(Directory.GetCurrentDirectory(), "zz_" + Guid.NewGuid().ToString() + "EmptyTestFile.txt");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DelegateOutOfProcTests.cs (1)
25var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("HttpSysServer"), "test", "testassets",
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StartupHook.cs (1)
50var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
WebHostBuilderIISExtensions.cs (1)
32var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
Microsoft.AspNetCore.Server.IntegrationTesting (22)
ApplicationPublisher.cs (1)
122var tempPath = Path.GetTempPath() + Guid.NewGuid().ToString("N");
CachingApplicationPublisher.cs (1)
70var destFileName = Path.Combine(target.FullName, fileInfo.Name);
Common\DotNetCommands.cs (4)
27var result = Path.Combine(Directory.GetCurrentDirectory(), _dotnetFolderName); 50result = Path.Combine(userProfile, _dotnetFolderName); 63var archSpecificDir = Path.Combine(dotnetDir, arch.ToString()); 83return Path.Combine(dotnetDir, dotnetFile);
Deployers\NginxDeployer.cs (4)
32_configFile = Path.GetTempFileName(); 138var pidFile = Path.Combine(DeploymentParameters.ApplicationPath, $"{Guid.NewGuid()}.nginx.pid"); 139var errorLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.error.log"); 140var accessLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.access.log");
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (9)
91_deployedFolderPathInFileShare = Path.Combine(_deploymentParameters.RemoteServerFileSharePath, folderId); 153var webConfigFilePath = Path.Combine(_deploymentParameters.PublishedApplicationRootPath, "web.config"); 163Path.Combine(_deploymentParameters.DotnetRuntimePath, "dotnet.exe")); 204executableParameters = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".dll"); 208executablePath = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".exe"); 289var temppath = Path.Combine(destDirName, file.Name); 297var temppath = Path.Combine(destDirName, subdir.Name); 318var physicalFilePath = Path.Combine(Path.GetTempPath(), embeddedFileName);
Deployers\SelfHostDeployer.cs (2)
98workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 103var executable = Path.Combine(workingDirectory, DeploymentParameters.ApplicationName + executableExtension);
xunit\IISExpressAncmSchema.cs (1)
21var ancmConfigPath = Path.Combine(
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (23)
IISDeployer.cs (11)
100_debugLogFile = Path.GetTempFileName(); 113IISDeploymentParameters.ServerConfigLocation = Path.Combine(@"C:\inetpub\temp\apppools", _appPoolName, $"{_appPoolName}.config"); 185var file = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, debugLogLocation); 308_configPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D")); 309_applicationHostConfig = Path.Combine(_configPath, "applicationHost.config"); 510HelixHelper.PreserveFile(Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"), fileNamePrefix + ".web.config"); 511HelixHelper.PreserveFile(Path.Combine(_configPath, "applicationHost.config"), fileNamePrefix + ".applicationHost.config"); 512HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\ApplicationHost.config"), fileNamePrefix + ".inetsrv.applicationHost.config"); 513HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\redirection.config"), fileNamePrefix + ".inetsrv.redirection.config"); 514var tmpFile = Path.GetRandomFileName();
IISDeployerBase.cs (4)
43var path = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"); 94var basePath = File.Exists(Path.Combine(AppContext.BaseDirectory, "x64", "aspnetcorev2.dll")) ? "" : @"ANCM\"; 96var ancmFile = Path.Combine(AppContext.BaseDirectory, arch); 99ancmFile = Path.Combine(AppContext.BaseDirectory, ancmDllName);
IISDeploymentParameterExtensions.cs (1)
132WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine(path, "std")));
IISExpressDeployer.cs (7)
69var entryPoint = Path.Combine(dllRoot, DeploymentParameters.ApplicationName + executableExtension); 120dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.RuntimeArchitecture.ToString(), 126dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 185WorkingDirectory = Path.GetDirectoryName(iisExpressPath) 298var webConfigPath = Path.Combine(contentRoot, "web.config"); 308DeploymentParameters.ServerConfigLocation = Path.GetTempFileName(); 384var iisExpressPath = Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + "\\", programFiles, "IIS Express", "iisexpress.exe");
Microsoft.AspNetCore.Server.Kestrel.Core (27)
Internal\CertificatePathWatcher.cs (7)
115var path = Path.Combine(_contentRootDir, certificateConfig.Path); 116var dir = Path.GetDirectoryName(path)!; 141() => dirMetadata.FileProvider.Watch(Path.GetFileName(path)), 176var dirMetadata = _metadataForDirectory[Path.GetDirectoryName(path)!]; 185var fileInfo = dirMetadata.FileProvider.GetFileInfo(Path.GetFileName(path)); 218var path = Path.Combine(_contentRootDir, certificateConfig.Path); 219var dir = Path.GetDirectoryName(path)!;
Internal\Certificates\CertificateConfigLoader.cs (3)
39var certificatePath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!); 45var certificateKeyPath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.KeyPath); 74return (new X509Certificate2(Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!), certInfo.Password), fullChain);
KestrelServerOptions.cs (1)
572if (!Path.IsPathRooted(socketPath))
ListenOptionsHttpsExtensions.cs (3)
39return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName))); 53return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password)); 68return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password), configureOptions);
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
TlsConfigurationLoader.cs (3)
200var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 201basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 202path = basePath != null ? Path.Combine(basePath, $"{applicationName}.pfx") : null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (23)
CertificatePathWatcherTests.cs (20)
22var fileName = Path.GetRandomFileName(); 23var filePath = Path.Combine(dir, fileName); 79dirs[i] = Path.Combine(rootDir, $"dir{i}"); 122var fileName = Path.GetRandomFileName(); 123var filePath = Path.Combine(dir, fileName); 172var fileName = Path.GetRandomFileName(); 173var filePath = Path.Combine(dir, fileName); 211var dir = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); 222Path = Path.Combine(dir, "test.pfx"), 239var fileName = Path.GetRandomFileName(); 240var filePath = Path.Combine(dir, fileName); 273var fileName = Path.GetRandomFileName(); 274var filePath = Path.Combine(dir, fileName); 313var fileName = Path.GetRandomFileName(); 314var filePath = Path.Combine(dir, fileName); 344var fileName = Path.GetRandomFileName(); 345var filePath = Path.Combine(dir, fileName); 404var fileName = Path.GetRandomFileName(); 405var filePath = Path.Combine(dir, fileName);
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
NamedPipesTransportBenchmark.cs (1)
41_pipeName = "MicrobenchmarksTestPipe-" + Path.GetRandomFileName();
Microsoft.AspNetCore.Server.Kestrel.Tests (49)
GeneratedCodeTests.cs (10)
24var httpHeadersGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpHeaders.Generated.cs"); 25var httpProtocolGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpProtocol.Generated.cs"); 26var httpUtilitiesGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpUtilities.Generated.cs"); 27var transportMultiplexedConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportMultiplexedConnection.Generated.cs"); 28var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportConnection.Generated.cs"); 30var testHttpHeadersGeneratedPath = Path.GetTempFileName(); 31var testHttpProtocolGeneratedPath = Path.GetTempFileName(); 32var testHttpUtilitiesGeneratedPath = Path.GetTempFileName(); 33var testTransportMultiplexedConnectionGeneratedPath = Path.GetTempFileName(); 34var testTransportConnectionGeneratedPath = Path.GetTempFileName();
HttpsConfigurationTests.cs (6)
28serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"); 90new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 127new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 160new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 193serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"); 222ServerCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"),
KestrelConfigurationLoaderTests.cs (30)
251Directory.CreateDirectory(Path.GetDirectoryName(path)); 292Directory.CreateDirectory(Path.GetDirectoryName(devCertPath)); 418Directory.CreateDirectory(Path.GetDirectoryName(path)); 465Directory.CreateDirectory(Path.GetDirectoryName(path)); 514Directory.CreateDirectory(Path.GetDirectoryName(path)); 567new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 568new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")) 591new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 592new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")), 616new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 617new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")), 641new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 642new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.pub")), 674var certificate = new X509Certificate2(TestResources.GetCertPath(Path.ChangeExtension(certificateFile, "crt"))); 680new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", certificateFile)), 681new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", certificateKey)), 708Directory.CreateDirectory(Path.GetDirectoryName(path)); 864Directory.CreateDirectory(Path.GetDirectoryName(certificatePath)); 944var oldDir = Directory.CreateDirectory(Path.Combine(tempDir, "old")); 945var newDir = Directory.CreateDirectory(Path.Combine(tempDir, "new")); 946var oldCertPath = Path.Combine(oldDir.FullName, "tls.key"); 947var newCertPath = Path.Combine(newDir.FullName, "tls.key"); 949var dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./old"); 950var fileLink = File.CreateSymbolicLink(Path.Combine(tempDir, "tls.key"), "./link/tls.key"); 995dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./new"); 1352var certPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.pem"); 1353var keyPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.key"); 1851var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 1852basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 1853return Path.Combine(basePath, $"TestApplication.pfx");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Shared.Tests (6)
DotNetMuxerTests.cs (5)
21Assert.True(Path.IsPathRooted(muxerPath), "The path should be rooted"); 22Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(muxerPath), ignoreCase: true); 30return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(depsFile), "..", "..", "..", "dotnet" + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "")));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Docker.cs (2)
62foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 64var candidate = Path.Combine(dir, "docker" + _exeSuffix);
Microsoft.AspNetCore.SpaProxy (6)
SpaHostingStartup.cs (1)
20var spaProxyConfigFile = Path.Combine(AppContext.BaseDirectory, "spa.proxy.json");
SpaProxyLaunchManager.cs (5)
178if (OperatingSystem.IsWindows() && !Path.HasExtension(command)) 197WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 243WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 268var scriptPath = Path.Combine(AppContext.BaseDirectory, fileName); 305WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory)
Microsoft.AspNetCore.SpaServices.Extensions (1)
StaticFiles\DefaultSpaStaticFileProvider.cs (1)
31var absoluteRootPath = Path.Combine(
Microsoft.AspNetCore.StaticAssets (5)
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (3)
26staticAssetsManifestPath = Path.Combine(AppContext.BaseDirectory, $"{environment.ApplicationName}.staticwebassets.endpoints.json"); 29staticAssetsManifestPath = Path.IsPathRooted(staticAssetsManifestPath) ? staticAssetsManifestPath : Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath);
StaticAssetsEndpointRouteBuilderExtensions.cs (2)
33staticAssetsManifestPath = !Path.IsPathRooted(staticAssetsManifestPath) ? 34Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath) :
Microsoft.AspNetCore.StaticAssets.Tests (11)
StaticAssetsIntegrationTests.cs (11)
109var filePath = Path.Combine(webRoot, "sample.txt"); 166File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified"); 219File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified"); 228Assert.Equal(GetGzipEtag(Path.Combine(webRoot, "sample.txt")), response.Headers.ETag.Tag); 257var contentRoot = Path.Combine(AppContext.BaseDirectory, appName); 258var webRoot = Path.Combine(contentRoot, "wwwroot"); 266var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{appName}.staticwebassets.endpoints.json"); 275var filePath = Path.Combine(webRoot, resource.Path); 295var compressedFilePath = Path.Combine(webRoot, resource.Path + ".gz"); 788return Path.GetExtension(filePath) switch 837public string Name => Path.GetFileName(testResource.Path);
Microsoft.AspNetCore.StaticFiles (2)
StaticFileMiddleware.cs (2)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
FallbackStaticFileTest.cs (1)
48FileProvider = new PhysicalFileProvider(Path.Combine(environment.WebRootPath, "SubFolder")),
StaticFileMiddlewareTests.cs (6)
108var last = File.GetLastWriteTimeUtc(Path.Combine(AppContext.BaseDirectory, "TestDocument.txt")); 145.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 158var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 187.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 200var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 247.UseWebRoot(Path.Combine(AppContext.BaseDirectory))
Microsoft.AspNetCore.StaticFiles.Tests (33)
DefaultContentTypeProviderTests.cs (1)
65Assert.True(provider.TryGetContentType($"{new string(System.IO.Path.GetInvalidPathChars())}.txt", out contentType));
DefaultFilesMiddlewareTests.cs (6)
60using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 83using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 126using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 208using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 255using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 310using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
DirectoryBrowserMiddlewareTests.cs (7)
81using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 100using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 141using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 214using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 258using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 308using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 356using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
StaticFileMiddlewareTests.cs (19)
51var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt"); 53Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit(); 72var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink)); 177using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 185var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 213using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 224var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 253using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 266var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 296using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 316var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 340using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 359var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 388using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 444using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, ".")); 470using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 478var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 530using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
Microsoft.AspNetCore.TestHost (2)
WebHostBuilderExtensions.cs (2)
158builder.UseContentRoot(Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath)));
Microsoft.AspNetCore.Tests (47)
WebApplicationTests.cs (47)
389var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 390var webRoot = Path.Combine(contentRoot, "wwwroot"); 409var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 410var webRoot = Path.Combine(contentRoot, "wwwroot"); 466var contentRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 474builder.Host.UseContentRoot(contentRoot + Path.DirectorySeparatorChar); 478builder.WebHost.UseContentRoot(contentRoot + Path.DirectorySeparatorChar); 500var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 502var fullWebRootPath = Path.Combine(contentRoot, "wwwroot2"); 529var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 531var fullWebRootPath = Path.Combine(contentRoot, "wwwroot"); 571var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 573var fullWebRootPath = Path.Combine(contentRoot, "wwwroot"); 620builder.Host.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory)); 624builder.WebHost.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory)); 631Path.TrimEndingDirectorySeparator(Path.GetFullPath(unnormalizedPath)); 786var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 789var fullWebRootPath = Path.Combine(contentRoot, webRoot); 829var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 832var fullWebRootPath = Path.Combine(contentRoot, webRoot); 878var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 881var fullWebRootPath = Path.Combine(contentRoot, webRoot); 1077var contentRoot = Path.GetTempPath().ToString(); 2214var wwwroot = Path.Combine(AppContext.BaseDirectory, "wwwroot"); 2247var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 2279ContentRootPath = Path.GetTempPath() 2298Assert.Equal(Path.GetTempPath(), hostEnv.ContentRootPath);
Microsoft.AspNetCore.WebSockets.ConformanceTests (9)
Autobahn\AutobahnTester.cs (3)
33var specFile = Path.GetTempFileName(); 64var outputFile = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", Spec.OutputDirectory, "index.json"); 133var configPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Http.config");
Autobahn\Executable.cs (2)
22foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 24var candidate = Path.Combine(dir, name + _exeSuffix);
AutobahnTests.cs (2)
38Path.Combine(AppContext.BaseDirectory, "autobahnreports"); 86var iisExpressExe = Path.Combine(pf, "IIS Express", "iisexpress.exe");
Helpers.cs (2)
10return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, projectName));
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
FileBufferingReadStream.cs (2)
243_tempFileName = Path.Combine(_tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid().ToString() + ".tmp"); 248var tempTempFileName = Path.GetTempFileName();
FileBufferingWriteStream.cs (3)
37/// uses the value returned by <see cref="Path.GetTempPath"/>. 270var tempFileName = Path.Combine(tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid() + ".tmp"); 275var tempTempFileName = Path.GetTempFileName();
Microsoft.AspNetCore.WebUtilities.Tests (3)
FileBufferingWriteStreamTests.cs (3)
12private readonly string TempDirectory = Path.Combine(Path.GetTempPath(), "FileBufferingWriteTests", Path.GetRandomFileName());
Microsoft.Build (326)
AssemblyLoadInfo.cs (1)
179ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BackEnd\BuildManager\BuildManager.cs (1)
1309submission.BuildRequestData.ProjectFullPath = Path.Combine(
BackEnd\BuildManager\CacheSerialization.cs (1)
33Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1426using (StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, @"EngineTrace_{0}.txt"), Process.GetCurrentProcess().Id), append: true))
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
151(_projectRootDirectory = Path.GetDirectoryName(RequestConfiguration.ProjectFullPath));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (5)
155nodeProcesses.AddRange(new List<Process>(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName)))); 214msbuildLocation = Path.Combine(msbuildExeName, ".exe"); 319string taskHostNameForClr2TaskHost = Path.GetFileNameWithoutExtension(NodeProviderOutOfProcTaskHost.TaskHostNameForClr2TaskHost); 320if (Path.GetFileNameWithoutExtension(msbuildLocation).Equals(taskHostNameForClr2TaskHost, StringComparison.OrdinalIgnoreCase)) 402var expectedProcessName = Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost() ?? msbuildLocation);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (3)
427if (s_pathToX64Clr2 == null || !FileUtilities.FileExistsNoThrow(Path.Combine(s_pathToX64Clr2, toolName))) 440if (s_pathToX32Clr2 == null || !FileUtilities.FileExistsNoThrow(Path.Combine(s_pathToX32Clr2, toolName))) 478return Path.Combine(toolPath, toolName);
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
181string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\FullTracking.cs (1)
106tracking._tlogDirectory = Path.Combine(projectRootDirectory, tlogRelativeDirectoryValue);
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (2)
554projectDirectory[i] = Path.GetDirectoryName(projectPath); 691outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
346if (!Path.IsPathRooted(projectFiles[i])) 348projectFiles[i] = Path.Combine(_requestEntry.ProjectRootDirectory, projectFiles[i]);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (5)
983string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 1008string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 1043string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1196path1 = Path.Combine(_project.Directory, path1); 1199path2 = Path.Combine(_project.Directory, path2);
BackEnd\Components\Scheduler\Scheduler.cs (4)
2570StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerTrace_{0}.txt"), Process.GetCurrentProcess().Id), append: true); 2588using (StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true)) 2696using (StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true)) 2730using (StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true))
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
33string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (4)
55Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 82Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location); 118var manifest = Path.Combine(subfolder.FullName, $"{subfolder.Name}.xml"); 119var assembly = Path.Combine(subfolder.FullName, $"{subfolder.Name}.dll");
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (3)
83if (!System.IO.Path.IsPathRooted(manifest.Path)) 85manifest.Path = System.IO.Path.Combine(manifestFolder, manifest.Path); 86manifest.Path = System.IO.Path.GetFullPath(manifest.Path);
BackEnd\Shared\BuildRequestConfiguration.cs (4)
302if (String.Equals(Path.GetFileName(ProjectFullPath), "dirs.proj", StringComparison.OrdinalIgnoreCase)) 705Directory.CreateDirectory(Path.GetDirectoryName(cacheFile)); 795ErrorUtilities.VerifyThrow(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases"); 964string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId));
BackEnd\Shared\TargetResult.cs (4)
215string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache)); 225string directoryName = Path.GetDirectoryName(filename); 249Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
BuildCheck\Analyzers\SharedOutputPathAnalyzer.cs (5)
71if (!Path.IsPathRooted(path)) 73path = Path.Combine(Path.GetDirectoryName(projectPath)!, path); 82Path.GetFileName(projectPath), 83Path.GetFileName(conflictingProject),
BuildCheck\Infrastructure\ConfigurationProvider.cs (1)
59configPath = Path.Combine(dir, configFileName);
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
839String.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), Process.GetCurrentProcess().Id, nodeId), append: true))
Construction\ProjectRootElement.cs (2)
420_directory = Path.GetDirectoryName(newFullPath); 2092_directory = Path.GetDirectoryName(fullPath);
Construction\Solution\ProjectInSolution.cs (3)
179_absolutePath = Path.Combine(ParentSolution.SolutionFileDirectory, _relativePath); 188_absolutePath = Path.GetFullPath(_absolutePath); 234internal string Extension => Path.GetExtension(_relativePath);
Construction\Solution\SolutionFile.cs (8)
221SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 386SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 414return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile)); 557new BuildEventFileInfo(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))), 865string fullPathToEtpProj = Path.Combine(SolutionFileDirectory, etpProj.RelativePath); 866string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); 919RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue) 1027ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj.RelativePath.IndexOfAny(Path.GetInvalidPathChars()) == -1,
Construction\Solution\SolutionProjectGenerator.cs (16)
947string escapedSolutionFile = EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath)); 949string localFile = Path.Combine(escapedSolutionDirectory, "before." + escapedSolutionFile + ".targets"); 953localFile = Path.Combine(escapedSolutionDirectory, "after." + escapedSolutionFile + ".targets"); 1282baseName = Path.Combine(_solutionFile.SolutionFileDirectory, MakeIntoSafeItemName(project.GetUniqueProjectName())); 1698(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.AltDirectorySeparatorChar) || 1699(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.DirectorySeparatorChar)) 1709lastFolderInPhysicalPath = Path.GetFileName(aspNetPhysicalPath); 1739string publishWebsitePath = EscapingUtilities.Escape(WebProjectOverrideFolder) + Path.DirectorySeparatorChar + EscapingUtilities.Escape(lastFolderInPhysicalPath) + Path.DirectorySeparatorChar; 2271if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 2273directoryName += Path.DirectorySeparatorChar; 2277globalProperties.AddProperty("SolutionExt", EscapingUtilities.Escape(Path.GetExtension(_solutionFile.FullPath))); 2278globalProperties.AddProperty("SolutionFileName", EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath))); 2279globalProperties.AddProperty("SolutionName", EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_solutionFile.FullPath))); 2281globalProperties.AddProperty(SolutionPathPropertyName, EscapingUtilities.Escape(Path.Combine(_solutionFile.SolutionFileDirectory, Path.GetFileName(_solutionFile.FullPath))));
DebugUtils.cs (6)
43debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 109var extension = Path.GetExtension(fileName); 110var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 112var fullPath = Path.Combine(DebugPath, fileName); 118fullPath = Path.Combine(DebugPath, fileName);
Definition\Toolset.cs (4)
416string rootPath = Path.GetPathRoot(Path.GetFullPath(toolsPathToUse)); 993if (Path.IsPathRooted(_overrideTasksPath)) 1094yield return (usingTask, Path.GetDirectoryName(defaultTasksFile));
Definition\ToolsetLocalReader.cs (1)
43System.IO.Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "Roslyn"),
Definition\ToolsetReader.cs (8)
170var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 196var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}"); 202var version = Path.GetFileName(d); 203var binPath = Path.Combine(d, "bin"); 656if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 658path = Path.GetFullPath( 659Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
ElementLocation\XmlDocumentWithLocation.cs (3)
388if (Path.GetFileName(fullPath).StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)) 391ErrorUtilities.VerifyThrow(Path.IsPathRooted(fullPath), "should be full path"); 392string directory = Path.GetDirectoryName(fullPath);
ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (5)
86return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar || lastCharacter == '\\'; 172if (state.EvaluationDirectory != null && !Path.IsPathRooted(item.ItemSpec)) 174list.Add(Path.GetFullPath(Path.Combine(state.EvaluationDirectory, item.ItemSpec)));
Evaluation\Evaluator.cs (8)
1171string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath)); 1172string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath)); 1175string projectFullPath = Path.Combine(projectDirectory, projectFile); 1177int rootLength = Path.GetPathRoot(projectDirectory).Length; 1893ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project), 1906ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project), 2132if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped)) 2134importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander.cs (39)
1607value = Path.GetFileName(elementLocation.File); 1611value = Path.GetFileNameWithoutExtension(elementLocation.File); 1619value = Path.GetExtension(elementLocation.File); 1623value = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(elementLocation.File)); 1627string directory = Path.GetDirectoryName(elementLocation.File); 1628int rootLength = Path.GetPathRoot(directory).Length; 1699return NativeMethodsShared.FrameworkBasePath + Path.DirectorySeparatorChar; 2403if (Path.IsPathRooted(unescapedPath)) 2413rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2446string combinedPath = Path.Combine(unescapedPath, relativePath); 2481if (Path.IsPathRooted(unescapedPath)) 2491rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2498directoryName = Path.GetDirectoryName(rootedPath); 2514directoryName = Path.GetDirectoryName(directoryName); 2558if (Path.IsPathRooted(unescapedPath)) 2568rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2571directoryName = Path.GetDirectoryName(rootedPath); 3498|| _receiverType == typeof(System.IO.Path)) 3538string startingDirectory = String.IsNullOrWhiteSpace(elementLocation.File) ? String.Empty : Path.GetDirectoryName(elementLocation.File); 4305else if (_receiverType == typeof(Path)) 4307if (string.Equals(_methodMethodName, nameof(Path.Combine), StringComparison.OrdinalIgnoreCase)) 4319returnVal = Path.Combine(arg0); 4326returnVal = Path.Combine(arg0, arg1); 4333returnVal = Path.Combine(arg0, arg1, arg2); 4340returnVal = Path.Combine(arg0, arg1, arg2, arg3); 4347returnVal = Path.Combine(Array.ConvertAll(args, o => (string)o)); 4353else if (string.Equals(_methodMethodName, nameof(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase)) 4357returnVal = Path.DirectorySeparatorChar; 4361else if (string.Equals(_methodMethodName, nameof(Path.GetFullPath), StringComparison.OrdinalIgnoreCase)) 4365returnVal = Path.GetFullPath(arg0); 4369else if (string.Equals(_methodMethodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase)) 4373returnVal = Path.IsPathRooted(arg0); 4377else if (string.Equals(_methodMethodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase)) 4381returnVal = Path.GetTempPath(); 4385else if (string.Equals(_methodMethodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase)) 4389returnVal = Path.GetFileName(arg0); 4393else if (string.Equals(_methodMethodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase)) 4397returnVal = Path.GetDirectoryName(arg0); 4887var logFile = Path.Combine(Directory.GetCurrentDirectory(), fileName);
Evaluation\IntrinsicFunctions.cs (2)
290return Path.Combine(NativeMethodsShared.FrameworkBasePath, m.Groups[0].Value) + Path.DirectorySeparatorChar;
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (1)
95evaluationLocation.File == null ? string.Empty : System.IO.Path.GetFileName(evaluationLocation.File),
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileMatcher.cs (10)
29private static readonly string s_directorySeparator = new string(Path.DirectorySeparatorChar, 1); 52private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 293Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 500longPath = Path.Combine(longPath, parts[i]); 527longParts[i - startingElement] = Path.GetFileName(longPath); 694return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 1989var filespecUnescapedFullyQualified = Path.Combine(projectDirectoryUnescaped, filespecUnescaped); 2080fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
FileUtilities.cs (38)
74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 477return NormalizePath(Path.Combine(paths)); 496Path.HasExtension(uncheckedFullPath); 500return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 683return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FrameworkLocationHelper.cs (31)
410? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 420? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 430? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 440? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 450? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 460? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 470? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 480? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 557Path.DirectorySeparatorChar.ToString(), 561Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 566s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 606s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 782var frameworkPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, prefix ?? string.Empty); 792return Path.Combine(complusInstallRoot, complusVersion); 797string leaf = Path.GetFileName(currentRuntimePath); 805string baseLocation = Path.GetDirectoryName(currentRuntimePath); 921combinedPath = Path.GetFullPath(combinedPath); 929? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 930: Path.Combine(NativeMethodsShared.FrameworkBasePath, "xbuild-frameworks"); 932return Path.GetFullPath(combinedPath); 980string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 983path = Path.Combine(path, "Profile", frameworkName.Profile); 986return Path.GetFullPath(path); 1010var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1012Path.AltDirectorySeparatorChar.ToString(), 1031fixedPath += Path.DirectorySeparatorChar; 1089string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1384Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 1395(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1396!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1428frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Globbing\MSBuildGlob.cs (3)
143var rootedInput = Path.Combine(_state.Value.GlobRoot, stringToMatch); 150normalizedInput += Path.DirectorySeparatorChar; 239var parentedFixedPart = Path.Combine(globRoot, fixedDirPart);
Graph\GraphBuilder.cs (7)
296if (!solutionDirectoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 298solutionDirectoryName += Path.DirectorySeparatorChar; 302solutionGlobalPropertiesBuilder["SolutionExt"] = EscapingUtilities.Escape(Path.GetExtension(Solution.FullPath)); 303solutionGlobalPropertiesBuilder["SolutionFileName"] = EscapingUtilities.Escape(Path.GetFileName(Solution.FullPath)); 304solutionGlobalPropertiesBuilder["SolutionName"] = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(Solution.FullPath)); 305solutionGlobalPropertiesBuilder[SolutionProjectGenerator.SolutionPathPropertyName] = EscapingUtilities.Escape(Path.Combine(Solution.SolutionFileDirectory, Path.GetFileName(Solution.FullPath)));
Graph\ProjectGraph.cs (1)
517var nodeName = Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
InprocTrackingNativeMethods.cs (1)
208string fileTrackerPath = Path.Combine(buildToolsPath, fileTrackerDllName.Value);
Instance\ProjectInstance.cs (3)
372_directory = Path.GetDirectoryName(projectPath); 429_directory = Path.GetDirectoryName(projectPath); 2816DirectoryPath = Path.GetDirectoryName(projectFile)
Instance\ProjectItemInstance.cs (1)
2154if (Path.DirectorySeparatorChar != '\\' && includeEscaped?.IndexOf('\\') > -1)
Instance\TaskFactories\AssemblyTaskFactory.cs (1)
275string assemblyName = loadInfo.AssemblyName ?? Path.GetFileName(loadInfo.AssemblyFile);
Instance\TaskRegistry.cs (7)
88private static string s_potentialTasksV4Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV4Filename); 107private static string s_potentialTasksV12Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV12Filename); 126private static string s_potentialTasksCoreLocation = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksCoreFilename); 371if (assemblyFile != null && !Path.IsPathRooted(assemblyFile)) 373assemblyFile = Strings.WeakIntern(Path.Combine(directoryOfImportingFile, assemblyFile)); 388string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile), s_tasksCoreFilename);
Logging\BinaryLogger\BinaryLogger.cs (3)
171logDirectory = Path.GetDirectoryName(FilePath); 392string fullPath = Path.GetFullPath(generatedFileUsedEventArgs.FilePath); 447FilePath = Path.GetFullPath(FilePath);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
389new ProjectImportsCollector(Path.GetRandomFileName(), false, runOnBackground: false); 1721filePath = Path.GetTempFileName();
Logging\BinaryLogger\ProjectImportsCollector.cs (4)
49=> Path.ChangeExtension(logFilePath, sourcesArchiveExtension); 70_archiveFilePath = Path.Combine( 73Path.GetFileName(logFilePath), 220filePath = Path.GetFullPath(filePath);
Logging\DistributedLoggers\DistributedFileLogger.cs (1)
105string extension = Path.GetExtension(_logFile);
Logging\FileLogger.cs (2)
105logDirectory = Path.GetDirectoryName(Path.GetFullPath(_logFileName));
Logging\LoggerDescription.cs (2)
59if (loggerAssemblyFile != null && !Path.IsPathRooted(loggerAssemblyFile)) 280AssemblyLoadInfo.Create(_loggerAssembly.AssemblyName, Path.GetFullPath(_loggerAssembly.AssemblyFile));
Logging\ProfilerLogger.cs (1)
292var content = System.IO.Path.GetExtension(FileToLog) == ".md"
Modifiers.cs (9)
413modifiedItemSpec = Path.GetPathRoot(fullPath); 422modifiedItemSpec += Path.DirectorySeparatorChar; 437modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 451modifiedItemSpec = Path.GetExtension(itemSpec); 566modifiedItemSpec = Path.Combine( 617if (!Path.IsPathRooted(path)) 650return Path.GetDirectoryName(path) == null; 663fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
PrintLineDebugger.cs (1)
150return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
Resources\Constants.cs (1)
352availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path)));
TempFileUtilities.cs (7)
46string basePath = Path.Combine(Path.GetTempPath(), msbuildTempFolder); 85string temporaryDirectory = Path.Combine(TempFileDirectory, "Temporary" + Guid.NewGuid().ToString("N"), subfolder ?? string.Empty); 186string file = Path.Combine(directory, $"{fileName}{extension}"); 210string destFile = Path.Combine(dest, fileInfo.Name); 215string destDir = Path.Combine(dest, subdirInfo.Name); 232: System.IO.Path.Combine(TempFileDirectory, name);
TypeLoader.cs (5)
54string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 55microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 192string[] localAssemblies = Directory.GetFiles(Path.GetDirectoryName(path), "*.dll"); 198assembliesDictionary.Add(Path.GetFileName(localPath), localPath); 203assembliesDictionary[Path.GetFileName(runtimeAssembly)] = runtimeAssembly;
Utilities\FileSpecMatchTester.cs (3)
68fileToMatch = FileUtilities.GetFullPathNoThrow(Path.Combine(_currentDirectory, fileToMatch)); 89string filename = Path.GetFileName(normalizedFileToMatch); 128var absoluteFixedDirPart = Path.Combine(currentDirectory, fixedDirPart);
Utilities\NuGetFrameworkWrapper.cs (2)
204Path.Combine(BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory, "Common7", "IDE", "CommonExtensions", "Microsoft", "NuGet") : 207string assemblyPath = Path.Combine(assemblyDirectory, NuGetFrameworksFileName);
Utilities\Utilities.cs (4)
483? Path.Combine(programFiles32, ReservedPropertyNames.extensionsPathSuffix) 499? Path.Combine( 518extensionsPath = Path.Combine(programFiles, ReservedPropertyNames.extensionsPathSuffix); 557string userExtensionsPath = Path.Combine(localAppData, ReservedPropertyNames.userExtensionsPathSuffix);
WindowsFileSystem.cs (3)
120var searchDirectoryPath = Path.Combine(directoryPath, "*"); 157result.Add(Path.Combine(directoryPath, findResult.CFileName)); 165Path.Combine(directoryPath, findResult.CFileName),
Xml\ProjectXmlUtilities.cs (1)
101if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4) && Path.GetExtension(element.Location.File).Equals(".dwproj", StringComparison.OrdinalIgnoreCase))
Microsoft.Build.BuildCheck.UnitTests (15)
EndToEndTests.cs (10)
29private static string TestAssetsRootPath { get; } = Path.Combine(Path.GetDirectoryName(typeof(EndToEndTests).Assembly.Location) ?? AppContext.BaseDirectory, "TestAssets"); 118_env.SetCurrentDirectory(Path.GetDirectoryName(projectFile.Path)); 123$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore" + 149var analysisCandidatePath = Path.Combine(TestAssetsRootPath, analysisCandidate); 153$"{Path.Combine(analysisCandidatePath, $"{analysisCandidate}.csproj")} /m:1 -nr:False -restore /p:OutputPath={env.CreateFolder().Path} -analyze -verbosity:n", 170var candidateAnalysisProjectPath = Path.Combine(TestAssetsRootPath, customAnalyzerName, $"{customAnalyzerName}.csproj"); 187var nugetTemplatePath = Path.Combine(analysisCandidatePath, "nugetTemplate.config"); 196AddPackageSource(doc, packageSourcesNode, $"Key{i}", Path.GetDirectoryName(candidatesNugetPackageFullPaths[i]) ?? string.Empty); 199doc.Save(Path.Combine(analysisCandidatePath, "nuget.config"));
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
Microsoft.Build.CommandLine.UnitTests (58)
CommandLineSwitches_Tests.cs (2)
1549yield return new object[] { $"a_file_with${Path.GetInvalidFileNameChars().First()}invalid_chars" }; 1550yield return new object[] { $"C:\\a_path\\with{Path.GetInvalidPathChars().First()}invalid\\chars" };
MSBuildServer_Tests.cs (6)
25using Path = System.IO.Path; 112string? dir = Path.GetDirectoryName(markerFile.Path); 121watcher.Filter = Path.GetFileName(markerFile.Path); 193string? dir = Path.GetDirectoryName(markerFile.Path); 201watcher.Filter = Path.GetFileName(markerFile.Path); 332_env.SetCurrentDirectory(Path.GetDirectoryName(project.Path));
NodeStatus_Transition_Tests.cs (2)
166Get-Content {{Path.Combine(directory, received)}} {{pipeline}} 169Get-Content {{Path.Combine(directory, verified)}} {{pipeline}}
PerfLog_Tests.cs (3)
42string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj"); 65string perfLogPath = Path.Combine(perfLogFolder.Path, "logs"); 78string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj");
TerminalLogger_Tests.cs (2)
671RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success); 675RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithoutTL.log")};verbosity=diagnostic", out success);
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
XMake_Tests.cs (38)
1107string tempdir = Path.GetTempPath(); 1108string projectFileName = Path.Combine(tempdir, "msbEnvironmenttest.proj"); 1145string tempdir = Path.GetTempPath(); 1146string projectFileName = Path.Combine(tempdir, "msbLoggertest.proj"); 1147string logFile = Path.Combine(tempdir, "logFile"); 1193? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe") 1245Directory.SetCurrentDirectory(Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe)); 1268string projectPath = Path.Combine(directory, "my.proj"); 1269string rspPath = Path.Combine(directory, AutoResponseFileName); 1375directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 1377string projectPath = Path.Combine(directory, "my.proj"); 1378string rspPath = Path.Combine(directory, AutoResponseFileName); 1381string exePath = Path.Combine(exeDirectory, MSBuildExeName); 1382string mainRspPath = Path.Combine(exeDirectory, AutoResponseFileName); 1419string projectPath = Path.Combine(directory, "my.proj"); 1420string rspPath = Path.Combine(directory, AutoResponseFileName); 1421string exePath = Path.Combine(directory, MSBuildExeName); 1534output.ShouldContain($"[A={directory.Path}{Path.DirectorySeparatorChar}]"); 1918if (Path.GetExtension(file).Contains("proj")) 1934string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 1957string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 2075distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2088distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2101distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2114distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($";Parameter1;logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2131fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + Path.Combine("..", "cat.log") + ";Parameter1" }; 2138distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;verbosity=Normal;logFile={Path.Combine(Directory.GetCurrentDirectory(), "..", "cat.log")};Parameter1", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2147distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;Parameter;;;Parameter;Parameter;logFile={Path.Combine(Directory.GetCurrentDirectory(), "msbuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2706string source = Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe); 2707dest = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 2719if (Path.GetFileName(d).Equals("TestTemp", StringComparison.InvariantCultureIgnoreCase)) 2728File.Copy(file, Path.Combine(dest, Path.GetFileName(file))); 2733string dirName = Path.GetFileName(directory); 2734string destSubDir = Path.Combine(dest, dirName); 2773File.WriteAllText(Path.Combine(testProject.TestRoot, item.Key), item.Value);
Microsoft.Build.Conversion.Core (28)
ProjectFileConverter.cs (28)
279solutionFile = Path.GetFullPath(value); 605nextItem.Include = Path.ChangeExtension(nextItem.Include, ".vcxproj"); 2124if (outputPath[outputPath.Length - 1] != Path.DirectorySeparatorChar) 2126outputPath += Path.DirectorySeparatorChar; 2689if (String.Equals(Path.GetExtension(pathToReferencedProject), 2693pathToReferencedProject = Path.ChangeExtension(pathToReferencedProject, XMakeProjectStrings.csprojFileExtension); 2695else if (String.Equals(Path.GetExtension(pathToReferencedProject), 2699pathToReferencedProject = Path.ChangeExtension(pathToReferencedProject, XMakeProjectStrings.vbprojFileExtension); 2793DirectoryInfo searchDirectory = new DirectoryInfo(Path.GetDirectoryName(Path.GetFullPath(this.oldProjectFile))); 2856from = Path.GetFullPath(from); 2857to = Path.GetFullPath(to); 2866return result.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 2930string fullPathToReferencedProject = Path.Combine( 2931Path.GetDirectoryName(this.solutionFile), 3236(String.Equals(Path.GetExtension(relPath), ".resx", StringComparison.OrdinalIgnoreCase) 3338path = Path.Combine(Path.GetDirectoryName(oldProjectFile), relPath); 3342if (Path.IsPathRooted(linkPath)) // absolute 3348path = Path.Combine(Path.GetDirectoryName(oldProjectFile), linkPath); 3810string projectFileDirectory = Path.GetDirectoryName(Path.GetFullPath(this.oldProjectFile)); 3811string officeDocumentFullPath = Path.GetFullPath(Path.Combine(projectFileDirectory, officeDocumentPath)); 3814if (String.Equals(projectFileDirectory, Path.GetDirectoryName(officeDocumentFullPath), StringComparison.OrdinalIgnoreCase)) 3869if (Path.IsPathRooted(ProjectPropertyElement.Value))
Microsoft.Build.Engine (129)
Conditionals\FunctionCallExpressionNode.cs (4)
49expandedValue = Path.GetFullPath(Path.Combine(Project.PerThreadProjectDirectory, expandedValue)); 85return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar;
Constants.cs (2)
129internal static readonly char[] DirectorySeparatorChar = { Path.DirectorySeparatorChar }; 133internal static readonly char[] PathSeparatorChar = { Path.PathSeparator };
Engine\Engine.cs (3)
591msbuildPath = Path.GetFullPath(typeof(Engine).Assembly.Location); 986pathTo20Framework = Path.Combine(Environment.SystemDirectory, @"Microsoft.NET\Framework\v2.0.50727"); 2903string childProjectFullPath = Path.GetFullPath(childProjectFile);
Engine\EngineLoggingServices.cs (5)
752ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithTargetNames", Path.GetFileName(projectFile), targetNames), 766ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", Path.GetFileName(projectFile)), 792string message = ResourceUtilities.FormatResourceString(success ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(projectFile)); 819ResourceUtilities.FormatResourceString("TargetStarted", targetName, Path.GetFileName(projectFile)), 842string message = ResourceUtilities.FormatResourceString(success ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Engine\Expander.cs (1)
831propertyValue = Path.GetFileName(thisFile);
Engine\IntrinsicFunctions.cs (3)
256string lookInDirectory = Path.GetFullPath(startingDirectory); 261string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 275lookInDirectory = Path.GetDirectoryName(lookInDirectory);
Engine\Project.cs (11)
1679EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(this.fullFileName)), PropertyType.ReservedProperty)); 1681int rootLength = Path.GetPathRoot(directoryName).Length; 1766string projectFullFileName = Path.GetFullPath(projectFileName); 2101string newFullProjectFilePath = Path.GetFullPath(projectFileName); 3722Path.GetDirectoryName(this.fullFileName) : Directory.GetCurrentDirectory(); 4026import.SetEvaluatedProjectPath(Path.GetFullPath(Path.Combine(projectDirectoryLocation, importedFilename))); 4030import.SetEvaluatedProjectPath(Path.GetFullPath(importedFilename)); 4076Path.GetDirectoryName(import.EvaluatedProjectPath), 4428return string.Equals(Path.GetExtension(filename), ".sln", StringComparison.OrdinalIgnoreCase); 4437return string.Equals(Path.GetExtension(filename), ".vcproj", StringComparison.OrdinalIgnoreCase);
Engine\ProjectSchemaValidationHandler.cs (2)
124schemaFile = Path.Combine(binPath, "Microsoft.Build.xsd"); 143projectFile = Path.GetFullPath(projectFile);
Engine\TargetDependencyAnalyzer.cs (5)
930string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 958string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 995string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1148path1 = Path.Combine(projectDirectory, path1); 1163path2 = Path.Combine(projectDirectory, path2);
Engine\TaskExecutionModule.cs (1)
228Path.GetFullPath(projectFileNames[i]) : null;
Engine\TaskRegistry.cs (2)
321? Path.GetDirectoryName(projectFile) 328assemblyFile = Path.Combine(projectDir, assemblyFile);
Engine\Toolset.cs (2)
90string rootPath = Path.GetPathRoot(Path.GetFullPath(toolsPathToUse));
Engine\ToolsetReader.cs (3)
464if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 466path = Path.GetFullPath( 467Path.Combine(FileUtilities.CurrentExecutableDirectory, trimmedValue));
LocalProvider\LocalNode.cs (2)
58string tempPath = Path.GetTempPath(); 69dumpFileName = Path.Combine(tempPath, "MSBuild_" + guid.ToString());
LocalProvider\LocalNodeProvider.cs (1)
762string msbuildLocation = Path.Combine(locationOfMSBuildExe, "MSBuild.exe");
Logging\DistributedLoggers\DistributedFileLogger.cs (1)
100string extension = Path.GetExtension(logFile);
Logging\LoggerDescription.cs (1)
237new AssemblyLoadInfo(loggerAssembly.AssemblyName, Path.GetFullPath(loggerAssembly.AssemblyFile));
Properties\BuildPropertyGroup.cs (2)
1346string extensionsPath32 = Path.Combine(programFiles32, ReservedPropertyNames.extensionsPathSuffix); 1358extensionsPath = Path.Combine(programFiles, ReservedPropertyNames.extensionsPathSuffix);
Resources\Constants.cs (1)
210availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(System.IO.Path)));
Shared\FileMatcher.cs (12)
24private static readonly string directorySeparator = new string(Path.DirectorySeparatorChar, 1); 25private static readonly string altDirectorySeparator = new string(Path.AltDirectorySeparatorChar, 1); 28internal static readonly char[] directorySeparatorCharacters = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 314longPath = Path.Combine(longPath, parts[i]); 341longParts[i - startingElement] = Path.GetFileName(longPath); 515return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 617(Path.GetExtension(file).Length == extensionLengthToEnforce)) 971if (-1 != filespec.IndexOfAny(Path.GetInvalidPathChars())) 1201fixedDirectoryPart = Path.Combine(projectDirectory, fixedDirectoryPart); 1238: Path.GetExtension(filenamePart);
Shared\FileUtilities.cs (21)
351string fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec)); 352modifiedItemSpec = Path.GetPathRoot(fullPath); 361modifiedItemSpec += Path.DirectorySeparatorChar; 367if (Path.GetDirectoryName(itemSpec) == null) 375modifiedItemSpec = Path.GetFileNameWithoutExtension(itemSpec); 381if (Path.GetDirectoryName(itemSpec) == null) 389modifiedItemSpec = Path.GetExtension(itemSpec); 530fileSpec += Path.DirectorySeparatorChar; 583return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 611string fullPath = EscapingUtilities.Escape(Path.GetFullPath(Path.Combine(currentDirectory, fileSpec))); 622fullPath += Path.DirectorySeparatorChar; 637string directory = Path.GetDirectoryName(fileSpec); 649directory += Path.DirectorySeparatorChar; 663string fileExtension = Path.GetExtension(fileName); 707return Path.GetDirectoryName(CurrentExecutablePath); 783return String.Equals(Path.GetExtension(filename), ".vcproj", StringComparison.OrdinalIgnoreCase); 823string result = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
Shared\FileUtilitiesRegex.cs (2)
29@"^[\{0}\{1}][\{0}\{1}][^\{0}\{1}]+[\{0}\{1}][^\{0}\{1}]+", Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
Shared\FrameworkLocationHelper.cs (10)
89Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 116Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 143Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 170Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 197Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 405string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 488string leaf = Path.GetFileName(currentRuntimePath); 498string baseLocation = Path.GetDirectoryName(currentRuntimePath); 560string combinedPath = Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework"); 561return Path.GetFullPath(combinedPath);
Shared\ProjectInSolution.cs (1)
150return Path.Combine(this.ParentSolution.SolutionFileDirectory, this.RelativePath);
Shared\SolutionParser.cs (6)
328solutionFileDirectory = Path.GetDirectoryName(Path.GetFullPath(solutionFile)); 614string fullPathToEtpProj = Path.Combine(solutionFileDirectory, etpProj.RelativePath); 615string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); 667proj.RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue); 784ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj.RelativePath.IndexOfAny(Path.GetInvalidPathChars()) == -1,
Solution\SolutionWrapperProject.cs (20)
247string solutionFileName = Path.GetFileName(solutionFile); 248string solutionFileLocation = Path.Combine(solutionFileDirectory, solutionFileName); 413deleteTask.SetParameterValue("Files", Path.GetFileName(solutionProjectCache)); 757vcbuildTask = AddResolveVCProjectOutputTaskElement(target, Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile)), 856projectPath = Path.ChangeExtension(fullProjectPath, tmpExtension); 969EscapingUtilities.Escape(Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile))), 1195(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.AltDirectorySeparatorChar) || 1196(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.DirectorySeparatorChar) 1207lastFolderInPhysicalPath = Path.GetFileName(aspNetPhysicalPath); 1230EscapingUtilities.Escape(webProjectOverrideFolder) + Path.DirectorySeparatorChar + 1231EscapingUtilities.Escape(lastFolderInPhysicalPath) + Path.DirectorySeparatorChar); 1865if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 1867directoryName += Path.DirectorySeparatorChar; 1871propertyGroup.AddNewProperty("SolutionExt", Path.GetExtension(solution.SolutionFile), true /* treat as literal */); 1872propertyGroup.AddNewProperty("SolutionFileName", Path.GetFileName(solution.SolutionFile), true /* treat as literal */); 1873propertyGroup.AddNewProperty("SolutionName", Path.GetFileNameWithoutExtension(solution.SolutionFile), true /* treat as literal */); 1875propertyGroup.AddNewProperty("SolutionPath", Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile)), true /* treat as literal */);
Solution\VCWrapperProject.cs (5)
47string projectFullPath = Path.GetFullPath(projectPath); 142string projectPath = Path.GetFullPath(vcProjectFilename); 215path = Path.GetDirectoryName(path); 322string vcBuildPath = Path.Combine(rootDir, relativePathFromValueOnLayout); 332vcBuildPath = Path.Combine(rootDir, relativePathFromValueOnBatch);
Microsoft.Build.Engine.OM.UnitTests (217)
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 616MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
Construction\ConstructionEditing_Tests.cs (4)
3172var testSdkDirectory = Path.Combine(testSdkRoot, "MSBuildUnitTestSdk", "Sdk"); 3175string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props"); 3176string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets"); 3196var updated = Path.Combine(testProject.TestRoot, "updated.proj");
Construction\ProjectFormatting_Tests.cs (7)
385directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 388string file = Path.Combine(directory, "test.proj"); 437directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 440string file = Path.Combine(directory, "test.proj"); 685FileUtilities.DeleteDirectoryNoThrow(Path.GetDirectoryName(file), false);
Construction\ProjectImportElement_Tests.cs (4)
236string tempPath = Path.GetTempPath(); 237string testTempPath = Path.Combine(tempPath, "UnitTestsPublicOm"); 238string projectfile = Path.Combine(testTempPath, "a.proj"); 239string targetsFile = Path.Combine(tempPath, "x.targets");
Construction\ProjectRootElement_Tests.cs (16)
163Assert.Equal(project.FullPath, Path.Combine(Directory.GetCurrentDirectory(), "X")); 192projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"); 210ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc")); 227ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc")); 242projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"); 534string path = Path.Combine(toolsPath, target); 633directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 635string path = Path.Combine(directory, file); 661Directory.SetCurrentDirectory(Path.GetTempPath()); // should be used for project.DirectoryPath; it must exist 665string file = "bar" + Path.DirectorySeparatorChar + "foo.proj"; 666string path = Path.Combine(curDir, file); 667directory = Path.Combine(curDir, "bar"); 1661var fullPath = Path.GetFullPath("foo"); 1763projectFileAssert.Invoke(Path.GetDirectoryName(initialLocation), Path.GetDirectoryName(reloadLocation), rootElement.DirectoryPath);
DebugUtils.cs (6)
43debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 109var extension = Path.GetExtension(fileName); 110var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 112var fullPath = Path.Combine(DebugPath, fileName); 118fullPath = Path.Combine(DebugPath, fileName);
Definition\DefinitionEditing_Tests.cs (17)
287string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;"); 669string directory = Path.GetDirectoryName(paths[0]); 670string wildcard = Path.Combine(directory, "*.xxx;"); 789string directory = Path.GetDirectoryName(paths[0]); 790string wildcard = Path.Combine(directory, "*.xxx;"); 1093string directory = Path.GetDirectoryName(paths[0]); 1094string wildcard = Path.Combine(directory, "*.xxx;"); 1111ProjectCollection.Escape(Path.Combine(directory, "i2.xxx"))); 1133string directory = Path.GetDirectoryName(paths[0]); 1134string wildcard = Path.Combine(directory, "*.xxx;"); 1143item.Rename(Path.Combine(directory, "i2.xxx")); 1387string directory = Path.GetDirectoryName(paths[0]); 1388string wildcard = Path.Combine(directory, "*.xxx;"); 1407ProjectCollection.Escape(Path.Combine(directory, "i2.xxx"))); 2206string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;");
Definition\Project_Tests.cs (42)
203string file = Path.GetTempPath() + Path.DirectorySeparatorChar + Guid.NewGuid().ToString("N"); 648Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386", "foo.dll")); 678project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 679projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 683project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 684projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 713project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 714projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 748project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 749projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 768<IntermediateAssembly Include='obj" + Path.DirectorySeparatorChar + "i386" 769+ Path.DirectorySeparatorChar 786project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 787projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 1714testFileRoot = Path.Combine(Path.GetTempPath(), "foodir"); 1720string filePath = Path.Combine(testFileRoot, fileName); 1726projectConstruction.AddItem("foo", Path.Combine(testFileRoot, "*.foo")); 2457directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 2458string subdirectory = Path.Combine(directory, "sub"); 2461string projectPath = Path.Combine(subdirectory, "a.proj"); 2462string targetsPath = Path.Combine(directory, "b.targets"); 2464string unevaluatedInclude = ".." + Path.DirectorySeparatorChar + "*"; 2465string evaluatedInclude = ".." + Path.DirectorySeparatorChar + "b.targets"; 2563string myTempDir = Path.Combine(Path.GetTempPath() + "MyTempDir"); 2570ProjectRootElement one = ProjectRootElement.Create(Path.Combine(myTempDir, "1.targets")); 2574ProjectRootElement two = ProjectRootElement.Create(Path.Combine(myTempDir, "2.targets")); 2578ProjectRootElement zero = ProjectRootElement.Create(Path.Combine(myTempDir, "0.targets")); 2582zero.AddImport(Path.Combine(myTempDir, "*.targets")); 3261var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "1.foo"); 3739var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "a.cs"); 4078string importPath = Path.Combine(pre.DirectoryPath, Guid.NewGuid().ToString()); 4121string importGlob = Path.Combine(pre.DirectoryPath, @"__NoMatch__\**");
Definition\ProjectCollection_Tests.cs (2)
1234collection.AddToolset(new Toolset("testTools", Path.GetTempPath(), collection, Path.GetTempPath()));
Definition\ProjectItem_Tests.cs (22)
351directory = Path.Combine(Path.GetTempPath(), "a"); 357subdirectory = Path.Combine(directory, "b"); 363file = Path.Combine(subdirectory, "c"); 398directory = Path.Combine(Path.GetTempPath(), "a"); 404subdirectory = Path.Combine(directory, "b"); 410file = Path.Combine(subdirectory, "c"); 762expectedInclude = expectedInclude.Select(p => setSlashes(p, Path.DirectorySeparatorChar)).ToArray(); 1092? Path.GetFullPath(Path.Combine(testRoot, relativeFragmentFromRootToFile, file)) 1093: Path.Combine(relativeFragmentFromRootToFile, file); 1103var projectFileDir = Path.GetDirectoryName(projectFile); 1981string projectDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 1985string sourceFile = Path.Combine(projectDirectory, "a.cs"); 1986string renamedSourceFile = Path.Combine(projectDirectory, "b.cs"); 1990project.FullPath = Path.Combine(projectDirectory, "test.proj"); // assign a path so the wildcards can lock onto something. 1994Assert.Equal(Path.GetFileName(sourceFile), projectItem.EvaluatedInclude); 1996projectItem.Rename(Path.GetFileName(renamedSourceFile)); 2000Assert.Equal(Path.GetFileName(renamedSourceFile), projectItem.EvaluatedInclude);
ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (36)
74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 477return NormalizePath(Path.Combine(paths)); 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 683return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Instance\ProjectInstance_Tests.cs (22)
286directory = Path.Combine(Path.GetTempPath(), "WildcardsInsideTargets"); 288file1 = Path.Combine(directory, "a.exe"); 289file2 = Path.Combine(directory, "b.exe"); 290file3 = Path.Combine(directory, "c.bat"); 295string path = Path.Combine(directory, "*.exe"); 421projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj"); 422projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj"); 457projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj"); 458projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj"); 500string tempDir = Path.GetTempFileName(); 503File.Create(Path.Combine(tempDir, "aItem.cs")).Dispose(); 505projA.FullPath = Path.Combine(tempDir, "a.proj"); 506projB.FullPath = Path.Combine(tempDir, "b.proj"); 531string projectA = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 532string projectB = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj"); 534string includeFileA = Path.Combine(ObjectModelHelpers.TempProjectDir, "aaa4.cs"); 535string includeFileB = Path.Combine(ObjectModelHelpers.TempProjectDir, "bbb4.cs");
NugetRestoreTests.cs (2)
26string msbuildExePath = Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe)!; 50RunnerUtilities.RunProcessAndGetOutput(Path.Combine(msbuildExePath, "nuget", "NuGet.exe"), "restore " + sln.Path + " -MSBuildPath \"" + msbuildExePath + "\"", out bool success, outputHelper: _output);
PrintLineDebugger.cs (1)
150return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
TempFileUtilities.cs (7)
46string basePath = Path.Combine(Path.GetTempPath(), msbuildTempFolder); 85string temporaryDirectory = Path.Combine(TempFileDirectory, "Temporary" + Guid.NewGuid().ToString("N"), subfolder ?? string.Empty); 186string file = Path.Combine(directory, $"{fileName}{extension}"); 210string destFile = Path.Combine(dest, fileInfo.Name); 215string destDir = Path.Combine(dest, subdirInfo.Name); 232: System.IO.Path.Combine(TempFileDirectory, name);
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TransientIO.cs (7)
33private static bool IsDirSlash(char c) => c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 53path = Path.GetFullPath(path); 65var parent = Path.GetDirectoryName(absolute); 82var absolute = Path.GetFullPath(Path.IsPathRooted(relative) ? relative : Path.Combine(tempRoot, relative));
WindowsFileSystem.cs (3)
120var searchDirectoryPath = Path.Combine(directoryPath, "*"); 157result.Add(Path.Combine(directoryPath, findResult.CFileName)); 165Path.Combine(directoryPath, findResult.CFileName),
Microsoft.Build.Engine.UnitTests (832)
BackEnd\BuildManager_Tests.cs (6)
352string shutdownProjectDirectory = Path.Combine(Path.GetTempPath(), String.Format(CultureInfo.InvariantCulture, "VSNodeShutdown_{0}_UnitTest", Process.GetCurrentProcess().Id)); 3439string fileName = Path.GetTempFileName(); 3463var resultsFiles = Directory.EnumerateFiles(directory).Select(Path.GetFileName); 3574string rootProjectPath = Path.Combine(shutdownProjectDirectory, String.Format(CultureInfo.InvariantCulture, "RootProj_{0}.proj", Guid.NewGuid().ToString("N"))); 3785root.FullPath = Path.GetTempFileName();
BackEnd\BuildRequestConfiguration_Tests.cs (3)
159Assert.Equal(config1.ProjectFullPath, Path.GetFullPath("file")); 468string problematicTmpPath = Path.Combine(originalTmp, "}", "blabla", "temp"); 494configWithoutEvaluation.ShouldSkipIsolationConstraintsForReference(Path.GetFullPath("foo"));
BackEnd\BuildRequestEngine_Tests.cs (3)
448BuildRequestData data = new BuildRequestData(Path.GetFullPath("TestFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null); 454BuildRequestData data2 = new BuildRequestData(Path.GetFullPath("OtherFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null); 472Assert.Equal(Path.GetFullPath("OtherFile"), _newConfiguration_Config.ProjectFullPath);
BackEnd\CustomTaskHelper.cs (3)
29string[] referenceAssemblies = new string[] { "System.dll", Path.Combine(referenceAssembliesPath, "Microsoft.Build.Framework.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Utilities.Core.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Tasks.Core.dll") };
BackEnd\IntrinsicTask_Tests.cs (7)
2478<i1 Remove='" + projectDirectory.Path + Path.DirectorySeparatorChar + @"*.tmp'/> 3261string tempPath = Path.GetTempPath(); 3262string directoryForTest = Path.Combine(tempPath, "IncludeCheckOnMetadata_3\\Test"); 3263string fileForTest = Path.Combine(directoryForTest, "a.dll"); 3283<Content Include='" + Path.Combine(directoryForTest, "..", "**") + @"' Condition=""'%(Content.Extension)' == '.dll'""/> 3292"[" + Path.Combine(directoryForTest, "..", "Test", "a.dll") + @"]->[.dll]->[Test" 3293+ Path.DirectorySeparatorChar + "]");
BackEnd\LoggingServicesLogMethod_Tests.cs (8)
443string tempPath = Path.GetTempPath(); 444string testTempPath = Path.Combine(tempPath, "VerifyErrorPostfixForInvalidProjectFileException"); 445string projectFile = Path.Combine(testTempPath, "a.proj"); 446string targetsFile = Path.Combine(testTempPath, "x.targets"); 828message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithTargetNames", Path.GetFileName(projectFile), targetNames); 832message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", Path.GetFileName(projectFile)); 1398string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(success ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(projectFile)); 1488string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
BackEnd\MSBuild_Tests.cs (7)
46Directory.SetCurrentDirectory(Path.GetTempPath()); 48string tempPath = Path.GetTempPath(); 63string fileName = Path.GetFileName(tempProject); 71int rootLength = Path.GetPathRoot(tempPath).Length; 74projectFile1 += Path.Combine(tempPathNoRoot, fileName); 760logger.AssertLogContains($"iout6=[a{Path.DirectorySeparatorChar}b.foo]"); 766logger.AssertLogContains($"iin6=[a{Path.DirectorySeparatorChar}b.foo]");
BackEnd\RequestBuilder_Tests.cs (1)
288return Path.GetTempPath() + "testProject" + configId + ".proj";
BackEnd\SdkResolverLoader_Tests.cs (26)
62var d1 = Directory.CreateDirectory(Path.Combine(root, "Resolver1")); 65var f1 = Path.Combine(d1.FullName, "Resolver1.dll"); 68var f2 = Path.Combine(d1.FullName, "Dependency.dll"); 69var f3 = Path.Combine(d1.FullName, "InvalidName.dll"); 70var f4 = Path.Combine(d1.FullName, "NoResolver.txt"); 95var testFolder = Directory.CreateDirectory(Path.Combine(root, "MyTestResolver")); 97var wrongResolverDll = Path.Combine(testFolder.FullName, "MyTestResolver.dll"); 98var resolverManifest = Path.Combine(testFolder.FullName, "MyTestResolver.xml"); 99var assemblyToLoad = Path.Combine(root, "SomeOtherResolver.dll"); 221var resolverPath = Path.Combine(root, "MyTestResolver"); 222var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 246var resolverPath = Path.Combine(root, "MyTestResolver"); 247var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 273var resolverPath = Path.Combine(root, "MyTestResolver"); 274var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 297var resolverPath = Path.Combine(root, "MyTestResolver"); 313var resolverPath = Path.Combine(root, "MyTestResolver"); 314var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 371var resolver1Path = Path.Combine(additionalRoot, resolver1, $"{resolver1}.dll"); 372Directory.CreateDirectory(Path.Combine(testRoot, resolver1)); 373File.WriteAllText(Path.Combine(testRoot, resolver1, $"{resolver1}.dll"), string.Empty); 374Directory.CreateDirectory(Path.Combine(additionalRoot, resolver1)); 377var resolver2Path = Path.Combine(testRoot, resolver2, $"{resolver2}.dll"); 378Directory.CreateDirectory(Path.Combine(testRoot, resolver2)); 381var resolver3Path = Path.Combine(additionalRoot, resolver3, $"{resolver3}.dll"); 382Directory.CreateDirectory(Path.Combine(additionalRoot, resolver3));
BackEnd\SdkResultOutOfProc_Tests.cs (10)
120string projectPath = Path.Combine(projectFolder, "TestProject.proj"); 155string entryProjectPath = Path.Combine(projectFolder, "EntryProject.proj"); 165string projectWithSdkImportPath = Path.Combine(projectFolder, "ProjectWithSdkImport.proj"); 213var sdkResolver = SetupSdkResolver(Path.GetDirectoryName(projectPath)); 229Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk1")); 230Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk2")); 246File.WriteAllText(Path.Combine(projectFolder, "Sdk1", "Sdk.props"), CleanupFileContents(sdk1propsContents)); 247File.WriteAllText(Path.Combine(projectFolder, "Sdk2", "Sdk.props"), CleanupFileContents(sdk2propsContents)); 254Path.Combine(projectFolder, "Sdk1"), 255Path.Combine(projectFolder, "Sdk2")
BackEnd\TargetUpToDateChecker_Tests.cs (1)
559string projectFile = Path.Combine(ObjectModelHelpers.TempProjectDir, "temp.proj");
BackEnd\TaskBuilder_Tests.cs (8)
437<CreateItem Include='{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\**\*.dll'> 450string slashAndBracket = Path.DirectorySeparatorChar.ToString() + "]"; 645string fileName = Path.GetFileName(realTaskPath); 646string directoryName = Path.GetDirectoryName(realTaskPath); 650string customTaskFolder = Path.Combine(directoryName, "buildCrossTargeting"); 654<UsingTask TaskName=`RegisterObject` AssemblyFile=`" + Path.Combine(customTaskFolder, "..", fileName) + @"` /> 959string projectAPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 960string projectBPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj");
BackEnd\TaskRegistry_Tests.cs (4)
165Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 270Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1149Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, expandedAssemblyFile == null ? null : Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1202Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!"
BinaryLogger_Tests.cs (15)
359RunnerUtilities.ExecMSBuild($"{_logFile} -flp:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic", out success); 362string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log")); 416RunnerUtilities.ExecMSBuild($"{projectFile.Path} -nr:False -bl:{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile2.log")};verbosity=normal", out bool success); 421string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log")); 425string text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile2.log")); 428RunnerUtilities.ExecMSBuild($"{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile3.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile4.log")};verbosity=normal", out success); 430text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile3.log")); 434text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile4.log")); 459var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip"); 479string symlinkPath = Path.Combine(testFolder2.Path, symlinkName); 480string symlinkLvl2Path = Path.Combine(testFolder2.Path, symlinkLvl2Name); 519var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip"); 666string expectedLog = Path.GetFullPath(expectedBinlogFile);
BuildEnvironmentHelper_Tests.cs (32)
27var msbuildPath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 28string expectedMSBuildPath = Path.Combine(msbuildPath, MSBuildExeName).ToLowerInvariant(); 36Path.GetDirectoryName(expectedMSBuildPath).ShouldBe(toolsDirectoryPath); 46var msBuildPath = Path.Combine(path, MSBuildExeName); 47var msBuildConfig = Path.Combine(path, $"{MSBuildExeName}.config"); 73var msBuildPath = Path.Combine(msbuildBinDirectory, MSBuildExeName); 74var msBuildConfig = Path.Combine(msbuildBinDirectory, $"{MSBuildExeName}.config"); 75var vsMSBuildDirectory = Path.Combine(env.TempFolderRoot, "MSBuild"); 184Path.GetFileName(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath).ShouldBe(MSBuildExeName); 359var msBuild64Exe = Path.Combine(env.BuildDirectory, "amd64", MSBuildExeName); 364BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 380BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 405var entryProcess = Path.Combine(Path.GetTempPath(), "foo.exe"); 410BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(Path.GetDirectoryName(entryProcess)); 421var msBuildAssembly = Path.Combine(env.BuildDirectory, "Microsoft.Build.dll"); 438var msBuildAssembly = Path.Combine(env.BuildDirectory64, "Microsoft.Build.dll"); 463public string MSBuildExePath64 => Path.Combine(BuildDirectory64, MSBuildExeName); 470BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild", toolsVersion, "Bin"); 471BuildDirectory64 = Path.Combine(BuildDirectory, "amd64"); 472DevEnvPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "devenv.exe"); 473BlendPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "blend.exe"); 478File.WriteAllText(Path.Combine(BuildDirectory, file), string.Empty); 484File.WriteAllText(Path.Combine(BuildDirectory64, file), string.Empty); 487Directory.CreateDirectory(Path.Combine(TempFolderRoot, "Common7", "IDE")); 506public string MSBuildExePath => Path.Combine(BuildDirectory, MSBuildExeName); 517TempFolderRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 518BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild"); 528Directory.CreateDirectory(Path.Combine(BuildDirectory, "amd64")); 529File.WriteAllText(Path.Combine(BuildDirectory, "amd64", msBuildExeName), string.Empty); 530File.WriteAllText(Path.Combine(BuildDirectory, "amd64", $"{MSBuildExePath}.config"), string.Empty);
BuildEventArgsSerialization_Tests.cs (1)
105projectFile: Path.Combine("a", "test.proj"),
ConsoleLogger_Tests.cs (3)
377string tempProjectDir = Path.Combine(Path.GetTempPath(), "EmptyTargetsOnDetailedButNotNotmal"); 378string tempProjectPath = Path.Combine(tempProjectDir, "test.proj");
Construction\ElementLocation_Tests.cs (7)
32Path.Combine(AppContext.BaseDirectory, "Microsoft.Common.targets"); 105file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 140file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Construction\SolutionFile_Tests.cs (26)
133string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 184string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 185string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproja.proj"); 285Project('{F14B399A-7131-4C87-9E4B-1186C45EF12D}') = 'RptProj', '" + Path.GetFileName(rptprojPath) + @"', '{CCCCCCCC-9925-4D57-9DAF-E0A9D936ABDB}' 289Project('{D2ABAB84-BF74-430A-B69E-9DC6D40DDA17}') = 'DwProj', '" + Path.GetFileName(dqprojPath) + @"', '{DEA89696-F42B-4B58-B7EE-017FF40817D1}' 309string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 310string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 504string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 505string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 506string proj3Path = Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest", "someproj3.etp"); 551<FILE>" + Path.Combine("..", "SomeFolder", "ClassLibrary1.csproj") + @"</FILE> 559Directory.CreateDirectory(Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest")); 576solution.ProjectsInOrder[3].RelativePath.ShouldBe(Path.Combine("ETPProjUpgradeTest", "..", "SomeFolder", "ClassLibrary1.csproj")); 594string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 652string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); 699var solutionFolder = env.CreateFolder(Path.Combine(FileUtilities.GetTemporaryDirectory(), "sln")); 700env.CreateFolder(Path.Combine(solutionFolder.Path, "RelativePath")); 703p.FullPath = Path.Combine(solutionFolder.Path, "RelativePath", "project file"); 704p.SolutionFileDirectory = Path.GetFullPath(solutionFolder.Path); 712proj.RelativePath.ShouldBe(Path.Combine("RelativePath", "project file")); 729sp.SolutionFileDirectory = Path.GetTempPath(); 2352string expectedRelativePath = Path.Combine("..", "ProjectA", "ProjectA.csproj"); 2355solution.ProjectsInOrder[0].AbsolutePath.ShouldBe(Path.GetFullPath(Path.Combine(Path.GetDirectoryName(solution.FullPath)!, expectedRelativePath)));
Construction\SolutionFilter_Tests.cs (27)
49TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "ClassLibrary"), createFolder: true); 50TransientTestFolder classLibSubFolder = testEnvironment.CreateFolder(Path.Combine(classLibFolder.Path, "ClassLibrary"), createFolder: true); 59TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "SimpleProject"), createFolder: true); 60TransientTestFolder simpleProjectSubFolder = testEnvironment.CreateFolder(Path.Combine(simpleProjectFolder.Path, "SimpleProject"), createFolder: true); 119Directory.GetCurrentDirectory().ShouldNotBe(Path.GetDirectoryName(filterFile.Path)); 224TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.Path, "src"), createFolder: true); 236Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build"", """ + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)) + @""", ""{69BE05E2-CBDA-4D27-9733-44E12B0F5627}"" 238Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""MSBuild"", """ + Path.Combine("src", Path.GetFileName(msbuild.Path)) + @""", ""{6F92CA55-1D15-4F34-B1FE-56C0B7EB455E}"" 240Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.CommandLine.UnitTests"", """ + Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)) + @""", ""{0ADDBC02-0076-4159-B351-2BF33FAA46B2}"" 242Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.Tasks.UnitTests"", """ + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)) + @""", ""{CF999BDE-02B3-431B-95E6-E88D621D9CBF}"" 262""" + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!).Replace("\\", "\\\\") + @""", 263""" + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!).Replace("\\", "\\\\") + @""" 268sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!)).ShouldBeTrue(); 269sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!)).ShouldBeTrue(); 272(sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)!)) 273|| sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(msbuild.Path)!)) 274|| sp.ProjectShouldBuild(Path.Combine("src", "notAProject.csproj")))
Construction\SolutionProjectGenerator_Tests.cs (24)
88TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 97TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 131TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 146TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 205TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 220TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 842<ProjectConfiguration Project=`{{786E302A-96CE-43DC-B640-D6B6CC9BF6C0}}` AbsolutePath=`##temp##{Path.Combine("Project1", "A.csproj")}` BuildProjectInSolution=`True`>Debug|AnyCPU</ProjectConfiguration> 843<ProjectConfiguration Project=`{{881C1674-4ECA-451D-85B6-D7C59B7F16FA}}` AbsolutePath=`##temp##{Path.Combine("Project2", "B.csproj")}` BuildProjectInSolution=`True`>Debug|AnyCPU<ProjectDependency Project=`{{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}}` /></ProjectConfiguration> 844<ProjectConfiguration Project=`{{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}}` AbsolutePath=`##temp##{Path.Combine("Project3", "C.csproj")}` BuildProjectInSolution=`True`>Debug|AnyCPU</ProjectConfiguration> 1085string tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "ClassLibrary1", "ClassLibrary1.csproj"); 1088tempProjectPath = Path.GetFullPath(tempProjectPath); 1092tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "MainApp", "MainApp.vcxproj"); 1093tempProjectPath = Path.GetFullPath(tempProjectPath); 2427string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), @" 2446ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), @" 2483string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), @" 2502ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), @" 2558string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), @" 2577string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, projectName), $@" 2587ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.props"), $@" 2594ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.targets"), $@" 2658projectInSolution.AbsolutePath.ShouldBe(Path.Combine(solution.SolutionFileDirectory, projectInSolution.RelativePath));
Definition\ProjectEvaluationContext_Tests.cs (53)
123{Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 1}, 124{Path.Combine(_env.DefaultTestDirectory.Path, "2.file"), 1} 182{ Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 2 } 377File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), ""); 387File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), ""); 437File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), ""); 438File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), ""); 444Path.Combine(projectDirectory1, "1"), 447<i Include=`{Path.Combine("**", "*.cs")}` /> 451Path.Combine(projectDirectory2, "2"), 454<i Include=`{Path.Combine("**", "*.cs")}` /> 461var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 471File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), ""); 472File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), ""); 492File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), ""); 493File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), ""); 499Path.Combine(project1Directory, "1"), 502<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/> 506Path.Combine(project2Directory, "2"), 509<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/> 516var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 520.Select(i => Path.Combine("..", "Glob", projectName, $"{projectName}.{i}")) 528File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), ""); 529File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), ""); 554File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), ""); 561Path.Combine(project1Directory.Path, "1"), 564<i Include=`{Path.Combine("Glob", "**", "*.cs")}` /> 569Path.Combine(project2Directory.Path, "2"), 572<i Include=`{Path.Combine(project1Directory.Path, "Glob", "**", "*.cs")}` /> 579var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 583.Select(i => Path.Combine("Glob", "1", i)) 590.Select(i => Path.Combine(project1Directory.Path, i)) 599File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), ""); 621File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 627Path.Combine(project1Directory.Path, "1"), 634Path.Combine(project2Directory.Path, "2"), 644var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 646? Path.Combine("..", "..", "glob") 647: Path.Combine("..", "..", "..", "glob"); 651.Select(i => Path.Combine(globFixedDirectoryPart, i)) 659File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 685? Path.Combine("..", "GlobDirectory") 701prependedGlobExpansion[i] = Path.Combine(itemSpecDirectoryPart, globExpansion[i]); 709<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/> 714<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/> 719.Select((p, i) => new ProjectSpecification(Path.Combine(testDirectory.Path, $"ProjectDirectory{i}", $"Project{i}.proj"), p)); 725File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 735File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 762File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup()); 772File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup()); 803var theFile = Path.Combine(projectDirectory, "0.cs"); 957projectContents.Select((p, i) => new ProjectSpecification(Path.Combine(_env.DefaultTestDirectory.Path, $"Project{i}.proj"), p)), 991Directory.CreateDirectory(Path.GetDirectoryName(projectFilePath));
Definition\ToolsetConfigurationReaderTestHelper.cs (3)
32s_testFolderFullPath = Path.Combine(Path.GetTempPath(), "configFileTests"); 34string configFilePath = Path.Combine(s_testFolderFullPath, "test.exe.config");
Definition\ToolsVersion_Tests.cs (6)
246if (Path.GetDirectoryName(file.Path).Equals(dir, StringComparison.OrdinalIgnoreCase) 252if (Path.GetDirectoryName(file.Path).Equals(overrideDir, StringComparison.OrdinalIgnoreCase) 921Path.GetFileName(path); 923string pathWithoutTrailingSlash = path.EndsWith(Path.DirectorySeparatorChar.ToString()) 934bool sameFolder = (String.Equals(Path.GetDirectoryName(candidate), 937return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern);
EscapingInProjects_Tests.cs (6)
638string path = Path.Combine(Path.GetTempPath(), projectRelativePath); 639string projectAbsolutePath = Path.Combine(path, projectName); 1804File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "a.weirdo"), String.Empty); 1805File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "b.weirdo"), String.Empty); 1806File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "c.weirdo"), String.Empty);
Evaluation\Evaluator_Tests.cs (145)
88yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true }; 89yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 90yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false }; 91yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "*.*proj")}""", true }; 94yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}')""", true }; 95yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 96yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}""", false }; 97yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true }; 100yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "realFile.csproj")}')""", true }; 101yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""'true'""", true }; 102yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}""", true }; 103yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true }; 108yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true }; 109yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 110yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false }; 111yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "*.*proj")}""", true }; 112yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "*.*proj")}""", true }; 277string tempPath = Path.GetTempPath(); 278string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets"); 279string subDirectory = Path.Combine(targetDirectory, "subdir"); 281string testTargetPath = Path.Combine(targetDirectory, "test.targets"); 282string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets"); 283string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets"); 284string subdirProjPath = Path.Combine(subDirectory, "test.proj"); 285string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets"); 286string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets"); 287string textTextPath = Path.Combine(targetDirectory, "test.txt"); 406string tempPath = Path.GetTempPath(); 407string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets"); 408string subDirectory = Path.Combine(targetDirectory, "subdir"); 410string testTargetPath = Path.Combine(targetDirectory, "test.targets"); 411string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets"); 412string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets"); 413string subdirProjPath = Path.Combine(subDirectory, "test.proj"); 414string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets"); 415string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets"); 416string textTextPath = Path.Combine(targetDirectory, "test.txt"); 434logger.AssertLogContains("PropertyOutsideTarget: " + Path.Combine("..", "test.txt")); 436logger.AssertLogContains("PropertyInsideTarget: " + Path.Combine("..", "test.txt")); 437logger.AssertLogContains("PropertyGroupInsideTarget: " + Path.Combine("..", "test.txt")); 478string tempPath = Path.GetTempPath(); 479string targetDirectory = Path.Combine(tempPath, "VerifyUsedUnInitializedPropertyInImports"); 481string targetAPath = Path.Combine(targetDirectory, "targetA.targets"); 482string targetBPath = Path.Combine(targetDirectory, "targetB.targets"); 483string projectPath = Path.Combine(targetDirectory, "test.proj"); 525string tempPath = Path.GetTempPath(); 526string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet"); 527string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 567string tempPath = Path.GetTempPath(); 568string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet"); 569string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 613string tempPath = Path.GetTempPath(); 614string targetDirectory = Path.Combine(tempPath, "SetPropertyToItself"); 615string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 659string tempPath = Path.GetTempPath(); 660string targetDirectory = Path.Combine(tempPath, "UsePropertyInCondition"); 661string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 703string tempPath = Path.GetTempPath(); 704string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSet"); 705string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 749string tempPath = Path.GetTempPath(); 750string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSetDuplicates"); 751string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 1097directory = Path.Combine(Path.GetTempPath(), "fol$der"); 1098directory2 = Path.Combine(Path.GetTempPath(), "fol$der" + Path.DirectorySeparatorChar + "fol$der2"); 1101string importPathRelativeEscaped = Path.Combine("fol$(x)$der2", "Escap%3beab$(x)leChar$ac%3BtersInI*tPa?h"); 1102string importRelative1 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInImportPath"); 1103string importRelative2 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInI_XXXX_tPath"); 1104importPath1 = Path.Combine(directory, importRelative1); 1105importPath2 = Path.Combine(directory, importRelative2); 1126projectPath = Path.Combine(directory, "my.proj"); // project path has $ in too 1356logger.AssertLogContains(aProjName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar); 1363logger.AssertLogContains(targets1FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar); 1370logger.AssertLogContains(targets2FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar + "b" + Path.DirectorySeparatorChar); 2189string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative"); 2190string directory2 = Path.Combine(directory, "sub"); 2192VerifyImportTargetRelativePath(directory, directory2, new string[] { Path.Combine("**", "*.targets") }); 2201string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative2"); 2202string directory2 = Path.Combine(directory, "sub"); 2207new string[] { Path.Combine(directory2, "*.targets"), Path.Combine(directory, "*.targets") }); 2216string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative3"); 2217string directory2 = Path.Combine(directory, "sub"); 2224Path.Combine(directory2, "..", "*.targets"), Path.Combine( 2238string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsFullPath"); 2239string directory2 = Path.Combine(directory, "sub"); 2242string file1 = Path.Combine(directory, "1.targets"); 2243string file2 = Path.Combine(directory2, "2.targets"); 2244string file3 = Path.Combine(directory2, "3.cpp.targets"); 3309string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyPropertySetInImportStillOverrides"); 3320string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3321string import = Path.Combine(projectDirectory, "import.proj"); 3370string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportDoesntAffectParentProjectAboveIt"); 3381string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3382string import = Path.Combine(projectDirectory, "import.proj"); 3430string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportAffectsParentProjectBelowIt"); 3441string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3442string import = Path.Combine(projectDirectory, "import.proj"); 3502string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyUnionBetweenImports"); 3513string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3514string import = Path.Combine(projectDirectory, "import.proj"); 3575string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDuplicateTreatAsLocalProperty"); 3586string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3587string import = Path.Combine(projectDirectory, "import.proj"); 3640string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyGlobalPropertyPassedToP2P"); 3651string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3652string project2 = Path.Combine(projectDirectory, "project2.proj"); 3702string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyLocalPropertyPropagatesIfExplicitlyPassedToP2P"); 3713string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3714string project2 = Path.Combine(projectDirectory, "project2.proj"); 4277string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDTDProcessingIsDisabled"); 4288string projectFilename = Path.Combine(projectDirectory, "project.proj"); 4432string projectDirectory = Path.Combine(Path.GetTempPath(), "ThrownInvalidProjectExceptionProperlyHandled"); 4443string primaryProject = Path.Combine(projectDirectory, "project.proj"); 4444string import = Path.Combine(projectDirectory, "import.proj"); 4967string tempPath = Path.GetTempPath(); 4968string targetDirectory = Path.Combine(tempPath, "LogPropertyAssignments"); 4969string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 5116string file0 = Path.Combine(directory, "my.proj"); 5117file1 = Path.Combine(directory, "1.targets"); 5118file2 = Path.Combine(directory2, "2.targets"); 5119file3 = Path.Combine(directory2, "3.cpp.targets"); 5120file4 = Path.Combine(directory2, "4.nottargets");
Evaluation\Expander_Tests.cs (86)
41private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 259Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[0].EvaluatedInclude); 265Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"seconddirectory"), itemsDir[0].EvaluatedInclude); 285Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude); 341Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, result); 533log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 555log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 577log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 658Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude); 696Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[5].EvaluatedInclude); 717Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"secondd;rectory"), items[5].EvaluatedInclude); 718Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"someo;herplace"), items[6].EvaluatedInclude); 759pi.SetMetadata("Meta" + m.ToString(), Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory", "file") + m.ToString() + ".ext"); 761pi.SetMetadata("Meta9", Path.Combine("seconddirectory", "file.ext")); 762pi.SetMetadata("Meta10", String.Format(";{0};{1};", Path.Combine("someo%3bherplace", "foo.txt"), Path.Combine("secondd%3brectory", "file.ext"))); 1380subdir1" + Path.DirectorySeparatorChar + @": aaa=111 1381subdir2" + Path.DirectorySeparatorChar + @": bbb=222 1431"subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar, 1483@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + 1484Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", 1505@"string$(p);dialogs%253b ; splash.bmp ; ; ; ; \jk ; l\mno%253bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%253bdef;ghi", 1616Assert.Equal(@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", expander.ExpandIntoStringAndUnescape(value, ExpanderOptions.ExpandAll, MockElementLocation.Instance)); 1644Assert.Equal("subdir1" + Path.DirectorySeparatorChar, expanded[5]); 1645Assert.Equal("subdir2" + Path.DirectorySeparatorChar, expanded[6]); 2092pg.Set(ProjectPropertyInstance.Create("RootPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root"))); 2093pg.Set(ProjectPropertyInstance.Create("MyPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root", "my", "project", "is", "here.proj"))); 2099Assert.Equal(Path.Combine(Path.DirectorySeparatorChar.ToString(), "my", "project", "is", "here.proj"), result); 2126pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo"))); 2127pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar)); 2131string result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot2.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2133result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2261pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo"))); 2262pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar)); 2268@"'$(PathRoot2.Endswith(`" + Path.DirectorySeparatorChar + "`))' == 'true'", 2279@"'$(PathRoot.EndsWith(" + Path.DirectorySeparatorChar + "))' == 'false'", 2463pg.Set(ProjectPropertyInstance.Create("ParentPath", Path.Combine(s_rootPathPrefix, "abc", "def"))); 2464pg.Set(ProjectPropertyInstance.Create("FilePath", Path.Combine(s_rootPathPrefix, "abc", "def", "foo.cpp"))); 2481pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt"))); 2487Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2626pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt"))); 2632Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2642pg.Set(ProjectPropertyInstance.Create("File", "foo goo" + Path.DirectorySeparatorChar + "file.txt")); 2647Path.Combine(s_rootPathPrefix, "foo goo") + "`, `$(File)`))", 2650Assert.Equal(Path.Combine(s_rootPathPrefix, "foo goo", "foo goo", "file.txt"), result); 2660pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt"))); 2665Path.Combine(s_rootPathPrefix, "foo baz") + @"`, `$(File)`))", 2668Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz", "foo bar", "baz.txt"), result); 2678pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt"))); 2683Path.Combine(s_rootPathPrefix, "foo baz") + @" `, `$(File)`))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2685Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz ", "foo bar", "baz.txt"), result); 2741pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt")); 2749Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2759pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt")); 3332string tempFile = Path.GetFileName(FileUtilities.GetTemporaryFile()); 3336string directoryStart = Path.Combine(tempPath, "one\\two\\three\\four\\five"); 3367MockElementLocation mockElementLocation = new MockElementLocation(Path.Combine(ObjectModelHelpers.TempProjectDir, "one", "two", "three", "four", "five", Path.GetRandomFileName())); 3374pg.Set(ProjectPropertyInstance.Create("FileToFind", Path.GetFileName(fileToFind))); 3412string fileWithPath = Path.Combine("foo", "bar", "file.txt"); 3562$"{Path.GetFullPath("one")}{Path.DirectorySeparatorChar}", 3566$"{Path.GetFullPath(Path.Combine("one", "two"))}{Path.DirectorySeparatorChar}", 3863pg.Set(ProjectPropertyInstance.Create("SomePath", Path.Combine(s_rootPathPrefix, "some", "path"))); 3873Assert.Equal(Path.Combine(s_rootPathPrefix, "some", "path", "fOo.Cs"), result); 4288string path = Path.Combine("foo", "bar"); 4299Assert.Equal(path + Path.DirectorySeparatorChar, result); 4304Assert.Equal(path + Path.DirectorySeparatorChar, result); 4818var expectedAlphaSquigglePath = Path.Combine("Alpha", ".squiggle"); 4819var expectedBetaSquigglePath = Path.Combine("Beta", ".squiggle"); 4820var expectedAlphaGammaSquigglePath = Path.Combine("Alpha", "Gamma", ".squiggle"); 4865var alphaOnePath = Path.Combine("alpha", "One.cs"); 4866var alphaThreePath = Path.Combine("alpha", "Three.cs"); 4906var alphaBetaPath = Path.Combine("alpha", "beta"); 4907var alphaDeltaPath = Path.Combine("alpha", "delta");
Evaluation\ImportFromMSBuildExtensionsPath_Tests.cs (40)
50extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), GetExtensionTargetsFileContent1()); 55projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", extnDir1, Path.Combine("tmp", "nonexistent"))); 92string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContentWithCondition); 95CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir1, Path.Combine("tmp", "nonexistent") }, 128string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 129string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn2.proj"), 133new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 }, 158string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 196string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 198string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), 204new[] { extnDir1, Path.Combine("tmp", "nonexistent"), extnDir2 }, 246string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("circularwildcardtest", "extn.proj"), 248string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("circularwildcardtest", "extn.proj"), 250string extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("circularwildcardtest", "extn3.proj"), 256string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("extensions2", "circularwildcardtest", "main.proj"), mainTargetsFileContent); 283string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 286CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { Path.Combine("tmp", "nonexistent"), extnDir1 }, 300extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 305Path.Combine("tmp", "nonexistent"))); 355string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 356string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2); 359CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 }, 399string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 400string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2); 407projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", Path.Combine("tmp", "non-existent"), extnDir1)); 486extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 488extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"), 490extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("xyz", "extn3.proj"), 566extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 627extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 698extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("Microsoft", "VisualStudio", "v99", "DNX", "Microsoft.DNX.Props"), 763extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"), 804extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"), string.Empty); 837logger.AssertLogContains(@"MSB4226: The imported project """ + Path.Combine("$(UndefinedProperty)", "filenotfound.props") 889extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 891extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"), 999var extnDir = Path.Combine(ObjectModelHelpers.TempProjectDir, extnDirName); 1000Directory.CreateDirectory(Path.Combine(extnDir, Path.GetDirectoryName(relativeFilePath))); 1001File.WriteAllText(Path.Combine(extnDir, relativeFilePath), fileContents);
Evaluation\ItemSpec_Tests.cs (3)
46var projectFile = Path.Combine(absoluteRootPath, "build.proj"); 47var absoluteSpec = Path.Combine(absoluteRootPath, "s.cs"); 83return new ProjectInstanceItemSpec(itemSpec, expander, location, Path.GetDirectoryName(location.File));
Evaluation\Preprocessor_Tests.cs (57)
94" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 102" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 109" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 138" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 146" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 153" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 182" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 190" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 197" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 226" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 234" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 244" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 274" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 308" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 319" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 326" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 385" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 428" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 440" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 450" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 486" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 498" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 508" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 515" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 525" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 559" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 567" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 574" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 581" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 588" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 620" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 628" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 635" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 642" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 649" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 680" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 706directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 710xml0.AddImport(directory + Path.DirectorySeparatorChar + "*.targets"); 712xml1 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "1.targets"); 716xml2 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "2.targets"); 720xml3 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "3.xxxxxx"); 736" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 742<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @"""> 744" + Path.Combine(directoryXmlCommentFriendly, "1.targets") + @" 757<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @"""> 759" + Path.Combine(directoryXmlCommentFriendly, "2.targets") + @" 769" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 856string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props"); 857string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets"); 970string importedPropsPath = Path.Combine(testDirectory, "Import.props"); 977string projectPath = Path.Combine(testDirectory, "TestProject.csproj"); 1061string sdkPropsPath1 = Path.Combine(sdk1, "Sdk.props"); 1062string sdkTargetsPath1 = Path.Combine(sdk1, "Sdk.targets"); 1075string sdkPropsPath2 = Path.Combine(sdk2, "Sdk.props"); 1076string sdkTargetsPath2 = Path.Combine(sdk2, "Sdk.targets"); 1095string importPath = Path.GetFullPath(import.ProjectFile);
Evaluation\ProjectSdkImplicitImport_Tests.cs (13)
89_testSdkDirectory = Path.Combine(_testSdkRoot, SdkName, "Sdk"); 90_sdkPropsPath = Path.Combine(_testSdkDirectory, "Sdk.props"); 91_sdkTargetsPath = Path.Combine(_testSdkDirectory, "Sdk.targets"); 190string testSdkDirectory = Directory.CreateDirectory(Path.Combine(_testSdkRoot, sdkName, "Sdk")).FullName; 192File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.props"), $"<Project><PropertyGroup><InitialImportProperty>{sdkName}</InitialImportProperty></PropertyGroup></Project>"); 193File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.targets"), $"<Project><PropertyGroup><FinalImportProperty>{sdkName}</FinalImportProperty></PropertyGroup></Project>"); 208VerifyPropertyFromImplicitImport(project, "InitialImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.props"), sdkNames.Last()); 209VerifyPropertyFromImplicitImport(project, "FinalImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.targets"), sdkNames.Last()); 353var p1Path = Path.Combine(projectFolder, "p1.proj"); 354var p2Path = Path.Combine(projectFolder, "p2.proj"); 540import.SdkResult.Path.ShouldBe(Path.GetDirectoryName(expectedSdkPath)); 668var expectedSdkPath = Path.GetDirectoryName(_sdkPropsPath); 671expectedSdkPath.ShouldBe(Path.GetDirectoryName(_sdkTargetsPath));
Evaluation\SdkResultEvaluation_Tests.cs (19)
129string projectPath = Path.Combine(_testFolder, "project.proj"); 158Path.Combine(_testFolder, "Sdk"), 165new[] { Path.Combine(_testFolder, "Sdk") }, 190string projectPath = Path.Combine(_testFolder, "project.proj"); 200string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props"); 201Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk")); 253Path.Combine(_testFolder, "Sdk1"), 254Path.Combine(_testFolder, "Sdk2") 278string projectPath = Path.Combine(_testFolder, "project.proj"); 288string sdk1PropsPath = Path.Combine(_testFolder, "Sdk1", "Sdk.props"); 289Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk1")); 299string sdk2PropsPath = Path.Combine(_testFolder, "Sdk2", "Sdk.props"); 300Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk2")); 354new[] { Path.Combine(_testFolder, "Sdk") }, 370string projectPath = Path.Combine(_testFolder, "project.proj"); 380string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props"); 381Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk")); 391string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets"); 447string projectPath = Path.Combine(_testFolder, "project.proj");
FileLogger_Tests.cs (15)
338string directory = Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N")); 339string log = Path.Combine(directory, "build.log"); 497fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log"); 499Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log") + ";", StringComparison.OrdinalIgnoreCase)); 503fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log"); 505Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log") + ";", StringComparison.OrdinalIgnoreCase)); 508Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "tempura")); 510fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile.log"); 512Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log") + ";", StringComparison.OrdinalIgnoreCase)); 517if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "tempura"))) 519File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log")); 520FileUtilities.DeleteWithoutTrailingBackslash(Path.Combine(Directory.GetCurrentDirectory(), "tempura")); 522File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile0.log")); 523File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log")); 524File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log"));
FileMatcher_Tests.cs (57)
66File.WriteAllBytes(Path.Combine(testFolder.Path, file), new byte[1]); 80TransientTestFolder tf2 = _env.CreateFolder(Path.Combine(testFolder.Path, "subfolder")); 81string symlinkPath = Path.Combine(tf2.Path, "mySymlink"); 105foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.Path, i.ToPlatformSlash()))) 107Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); 127.Select(i => i.Replace(Path.DirectorySeparatorChar, '\\')) 619return new string[] { Path.Combine(path, "LongDirectoryName") }; 626return new string[] { Path.Combine(path, "LongSubDirectory") }; 633return new string[] { Path.Combine(path, "LongFileName.txt") }; 640return new string[] { Path.Combine(path, "pomegranate") }; 657private static readonly char S = Path.DirectorySeparatorChar; 788"Source" + Path.DirectorySeparatorChar + "**", 791"Source" + Path.DirectorySeparatorChar + "Bart.txt", 792"Source" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt", 796"Destination" + Path.DirectorySeparatorChar + "Bart.txt", 797"Destination" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt", 996ValidateFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.txt"), false); 997ValidateNoFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.bin"), false); 1003ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File.txt"), false); 1007ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File"), false); 1009ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File.txt" }), false); 1010ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File" }), false); 1021ValidateFileMatch(Path.Combine("**", "*.cs"), Path.Combine("dir1", "dir2", "file.cs"), true); 1022ValidateFileMatch(Path.Combine("**", "*.cs"), "file.cs", true); 1225string workingPathSubfolder = Path.Combine(workingPath, "SubDir"); 1226string offendingPattern = Path.Combine(workingPath, @"*\..\bar"); 1239string fileName = Path.Combine(workingPath, "MyFile.txt"); 1240string offendingPattern = Path.Combine(workingPath, @"**\**"); 1256string workingPathSubdir = Path.Combine(workingPath, "subdir"); 1257string workingPathSubdirBing = Path.Combine(workingPathSubdir, "bing"); 1259string offendingPattern = Path.Combine(workingPath, @"**\sub*\*."); 2069candidateDirectoryName = Path.GetDirectoryName(normalizedCandidate); 2111if (normalizedCandidate == Path.Combine(path, pattern)) 2153string baseMatch = Path.GetFileName(normalizedCandidate.Substring(0, nextSlash)); 2226string normalized = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 2227if (Path.DirectorySeparatorChar != '\\') 2229normalized = path.Replace("\\", Path.DirectorySeparatorChar.ToString()); 2238normalized = normalized.Replace(@".." + Path.DirectorySeparatorChar, "<:PARENT:>"); 2241string doubleSeparator = Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString(); 2242normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2243normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2244normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2247normalized = normalized.Replace(@"." + Path.DirectorySeparatorChar, ""); 2251normalized = normalized.Replace("<:PARENT:>", @".." + Path.DirectorySeparatorChar); 2268if (path.Length == 0 && !Path.IsPathRooted(candidate)) 2461return new string[] { Path.Combine(path, pattern) };
FileUtilities_Tests.cs (29)
44Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier); 48Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier); 419Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 433Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 555Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(Path.GetTempPath())); 776Assert.StartsWith(Path.GetTempPath(), path); 798Assert.StartsWith(Path.GetTempPath(), path); 813string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "subfolder"); 844Assert.StartsWith(Path.GetTempPath(), path); 883var secondSlash = SystemSpecificAbsolutePath.Substring(1).IndexOf(Path.DirectorySeparatorChar) + 1; 907string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); 908string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath))); 938string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); 939string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath))); 966string path = Path.Combine(root, "1", "2", "3", "4", "5"); 968Assert.Equal(Path.Combine(root, "1", "2", "3", "4", "5"), FileUtilities.GetFolderAbove(path, 0)); 969Assert.Equal(Path.Combine(root, "1", "2", "3", "4"), FileUtilities.GetFolderAbove(path)); 970Assert.Equal(Path.Combine(root, "1", "2", "3"), FileUtilities.GetFolderAbove(path, 2)); 971Assert.Equal(Path.Combine(root, "1", "2"), FileUtilities.GetFolderAbove(path, 3)); 972Assert.Equal(Path.Combine(root, "1"), FileUtilities.GetFolderAbove(path, 4)); 986Path.Combine(root, "path1"), 990Path.Combine(root, "path1", "path2", "file.txt"), 1032expectedTruncatedPath = expectedTruncatedPath.Replace('/', Path.DirectorySeparatorChar);
FixPathOnUnix_Tests.cs (2)
42ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("projectDirectory", "lib", "foo.dll"), "just a text file"); 53logger.AssertLogContains($"ItemMetadata: Md0 = {Path.Combine("lib", "foo.dll")}");
Globbing\MSBuildGlob_Tests.cs (8)
33Assert.Equal(glob.TestOnlyGlobRoot.LastOrDefault(), Path.DirectorySeparatorChar); 42var expectedRoot = Path.Combine(Directory.GetCurrentDirectory(), globRoot).WithTrailingSlash(); 116var expectedFixedDirectory = Path.Combine(globRoot, "b").WithTrailingSlash(); 167Assert.EndsWith("%42" + Path.DirectorySeparatorChar, glob.FixedDirectoryPart); 312return Path.Combine(Directory.GetCurrentDirectory(), expectedFixedDirectoryPart).Replace("/", "\\").WithTrailingSlash(); 352string normalizedPath = path.Replace(Path.DirectorySeparatorChar == '/' ? '\\' : '/', Path.DirectorySeparatorChar); 356var rootedFixedDirectoryPart = Path.Combine(FileUtilities.NormalizePath(globRoot), fixedDirectoryPart);
Graph\GetCompatiblePlatformGraph_Tests.cs (6)
365TransientTestFolder project1Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, firstProjectName), createFolder: true); 366TransientTestFolder project1SubFolder = testEnvironment.CreateFolder(Path.Combine(project1Folder.Path, firstProjectName), createFolder: true); 380TransientTestFolder project2Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, secondProjectName), createFolder: true); 381TransientTestFolder project2SubFolder = testEnvironment.CreateFolder(Path.Combine(project2Folder.Path, secondProjectName), createFolder: true); 391TransientTestFolder project3Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, thirdProjectName), createFolder: true); 392TransientTestFolder project3SubFolder = testEnvironment.CreateFolder(Path.Combine(project3Folder.Path, thirdProjectName), createFolder: true);
Graph\GraphTestingUtilities.cs (2)
169return Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath); 175return Path.GetFileNameWithoutExtension(config.ProjectFullPath);
Graph\IsolateProjects_Tests.cs (4)
143_env.SetTempPath(Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid().ToString("N")), deleteTempDirectory: true); 453var directory = Path.GetDirectoryName(path); 454var file = Path.GetFileName(path); 456return Path.Combine("..", directory, file);
Graph\ProjectGraph_Tests.cs (10)
843string project1Path = Path.Combine(env.DefaultTestDirectory.Path, "Project1.csproj"); 844string project2Path = Path.Combine(env.DefaultTestDirectory.Path, "Project2.vcxproj"); 845string project3Path = Path.Combine(env.DefaultTestDirectory.Path, "Project3.vcxproj"); 846string project4Path = Path.Combine(env.DefaultTestDirectory.Path, "Project4.vcxproj"); 847string project5Path = Path.Combine(env.DefaultTestDirectory.Path, "Project5.vcxproj"); 848string project6Path = Path.Combine(env.DefaultTestDirectory.Path, "Project6.wapproj"); 849string project7Path = Path.Combine(env.DefaultTestDirectory.Path, "Project7.csproj"); 850string project8Path = Path.Combine(env.DefaultTestDirectory.Path, "Project8.csproj"); 2108var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet(); 2114referenceNumbersSet = innerBuildWithAdditionalReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
Graph\ResultCacheBasedBuilds_Tests.cs (2)
350var rootNode = topoSortedNodes.First(n => Path.GetFileNameWithoutExtension(n.ProjectInstance.FullPath) == "1"); 510private static string ProjectNumber(ProjectGraphNode node) => Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance_Internal_Tests.cs (2)
73project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t0", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af0")); 74project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t1", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af1a"));
InvalidProjectFileException_Tests.cs (2)
31string file = Path.GetTempPath() + Guid.NewGuid().ToString("N"); 63string file = Path.GetTempPath() + Guid.NewGuid().ToString("N");
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectCache\ProjectCacheTests.cs (6)
52Path.GetFullPath( 53Path.Combine( 607var projectName = Path.GetFileNameWithoutExtension(projectPath); 637var projectName = Path.GetFileNameWithoutExtension(projectPath); 834private static int GetProjectNumber(string projectPath) => int.Parse(Path.GetFileNameWithoutExtension(projectPath)); 865itemResult.GetMetadata("File").ShouldBe(Path.GetFileName(projectPath));
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TypeLoader_Dependencies_Tests.cs (9)
17private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "TaskWithDependency"); 27string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 33string dllPath = Path.Combine(dir.Path, TaskDllFileName); 45string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 48var newTaskDllPath = Path.Combine(tempDir, TaskDllFileName); 65var originalTaskDllPath = Path.Combine(originalDirectory, TaskDllFileName); 66var originalDependencyDllPath = Path.Combine(originalDirectory, DependencyDllFileName); 70var newTaskDllPath = Path.Combine(temporaryDirectory, TaskDllFileName); 71var newDependencyDllPath = Path.Combine(temporaryDirectory, DependencyDllFileName);
TypeLoader_Tests.cs (18)
21private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "PortableTask"); 24private static string PortableTaskFolderPath = Path.GetFullPath( 25Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "..", "..", "..", "Samples", "PortableTask")); 67string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 75string dllPath = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, dllName); 84string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 90string dllPath = Path.Combine(dir.Path, DLLFileName); 104string newAssemblyLocation = Path.Combine(folder.Path, Path.GetFileName(currentAssembly)); 107string portableTaskPath = Path.Combine(Directory.GetDirectories(PortableTaskFolderPath).First(), "netstandard2.0", "OldMSBuild"); 108string utilities = Path.Combine(portableTaskPath, utilitiesName); 109File.Copy(utilities, Path.Combine(folder.Path, utilitiesName)); 123string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 124string originalDLLPath = Path.Combine(dir.Path, DLLFileName); 148string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 149string originalDLLPath = Path.Combine(dir.Path, DLLFileName); 174var newDllPath = Path.Combine(temporaryDirectory, DLLFileName); 201var tempDirectoryPath = Path.GetDirectoryName(newDllPath);
Microsoft.Build.Framework (13)
Constants.cs (2)
129internal static readonly char[] DirectorySeparatorChar = { Path.DirectorySeparatorChar }; 133internal static readonly char[] PathSeparatorChar = { Path.PathSeparator };
FileClassifier.cs (6)
88RegisterImmutableDirectory(Path.Combine(programFiles, "Reference Assemblies", "Microsoft")); 121string processFileName = Path.GetFileNameWithoutExtension(processName); 144Path.GetDirectoryName(msBuildAssembly)?.EndsWith(@"\amd64", StringComparison.OrdinalIgnoreCase) == true 201if (lastChar != Path.DirectorySeparatorChar && lastChar != Path.AltDirectorySeparatorChar) 203fileSpec += Path.DirectorySeparatorChar;
NativeMethods.cs (2)
763Path.GetDirectoryName(baseTypeLocation) 783dir = Path.GetDirectoryName(dir);
ProjectFinishedEventArgs.cs (1)
115RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(ProjectFile));
ProjectStartedEventArgs.cs (1)
482string? projectFilePath = Path.GetFileName(ProjectFile);
TargetFinishedEventArgs.cs (1)
182RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Microsoft.Build.Framework.UnitTests (20)
FileClassifier_Tests.cs (15)
27classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 28classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}"); 30classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 31classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue(); 32classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse(); 44classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 45classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}"); 48classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 49classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue(); 50classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse(); 59classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 63classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 64classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeFalse(); 68classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 69classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeTrue();
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
Microsoft.Build.Tasks.Core (363)
AssemblyDependency\Reference.cs (5)
445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference."); 538_directoryName = Path.GetDirectoryName(_fullPath); 558_fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_fullPath); 573_fullPathWithoutExtension = Path.Combine(DirectoryName, FileNameWithoutExtension);
AssemblyDependency\ReferenceTable.cs (17)
447if (!Path.IsPathRooted(assemblyFileName)) 449reference.FullPath = Path.GetFullPath(assemblyFileName); 497string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName); 734pathRooted = Path.IsPathRooted(finalName); 873Path.GetExtension(itemSpec)); 933if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll") 935companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile); 972string cultureName = Path.GetFileName(subDirectory); 976string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename); 980reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename)); 999string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename); 2760ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, satelliteFile)); 2764item.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile))); 2773ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, serializationAssemblyFile)); 2784ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, scatterFile)); 2821referenceItem.SetMetadata(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
AssemblyDependency\ResolveAssemblyReference.cs (1)
2837string fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
AssemblyDependency\Resolver.cs (5)
161string candidateBaseName = Path.GetFileNameWithoutExtension(pathToCandidateAssembly); 325fullPath = Path.Combine(directory, baseName); 372string weakNameBaseExtension = Path.GetExtension(weakNameBase); 373string weakNameBaseFileName = Path.GetFileNameWithoutExtension(weakNameBase); 381string fullPath = Path.Combine(directory, weakNameBase);
AssignTargetPath.cs (5)
55string fullRootPath = Path.GetFullPath(RootFolder); 91!Path.IsPathRooted(Files[i].ItemSpec) && 93!Files[i].ItemSpec.Contains("." + Path.DirectorySeparatorChar) && 107string itemSpecFullFileNamePath = Path.GetFullPath(Files[i].ItemSpec); 117targetPath = Path.GetFileName(Files[i].ItemSpec);
BootstrapperUtil\BootstrapperBuilder.cs (27)
174string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE); 361string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN); 430invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar); 453packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar))); 457string folder = System.IO.Path.GetDirectoryName(file); 503private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH); 505private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH); 507private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH); 528string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH); 535string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory); 536string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE); 606if ((strSubDirectory.ToCharArray())[nStartIndex] == System.IO.Path.DirectorySeparatorChar) 880string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory); 883string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE); 884string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 922UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory); 935string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE); 936string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 967System.IO.Path.DirectorySeparatorChar) 1172string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath); 1176targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath); 1179string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath); 1468string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value); 1477EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName)); 1996using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8)) 2038using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append)) 2199string logPath = System.IO.Path.Combine(
BootstrapperUtil\ResourceUpdater.cs (1)
39string filePath = Path.Combine(Directory.GetCurrentDirectory(), filename);
BootstrapperUtil\Util.cs (1)
195string msbuildExtensionPackagesPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildExtensionsPath, BOOTSTRAPPER_MSBUILD_ADDITIONAL_PACKAGES_PATH);
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 616MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CombinePath.cs (1)
70combinedPath.ItemSpec = Path.Combine(BasePath, path.ItemSpec);
ConvertToAbsolutePath.cs (1)
56if (!Path.IsPathRooted(path.ItemSpec))
Copy.cs (8)
255string destinationFolder = Path.GetDirectoryName(destinationFileState.Name); 729() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)), 756string srcName = Path.GetFileName(src); 763() => Path.Combine(src, file), 773() => Path.Combine(DestinationFolder.ItemSpec, srcName, file), 1058source.FileNameFullPath = Path.GetFullPath(source.Name); 1059destination.FileNameFullPath = Path.GetFullPath(destination.Name);
CreateCSharpManifestResourceName.cs (10)
148string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 149string directoryName = Path.GetDirectoryName(info.cultureNeutralFilename); 166manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 169manifestName.Replace(Path.DirectorySeparatorChar, '.'); 170manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 191manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 194manifestName.Replace(Path.DirectorySeparatorChar, '.'); 195manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 202manifestName.Insert(0, Path.DirectorySeparatorChar); 219string extension = Path.GetExtension(fileName);
CreateManifestResourceName.cs (8)
147string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 159isResxFile = Path.GetExtension(fileName) == resxFileExtension; 166string conventionDependentUpon = Path.ChangeExtension(Path.GetFileName(fileName), SourceFileExtension); 181if (File.Exists(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon))) 205string pathToDependent = Path.Combine(Path.GetDirectoryName(fileName), dependentUpon);
CreateVisualBasicManifestResourceName.cs (5)
152string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 160manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 176manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 183manifestName.Insert(0, Path.DirectorySeparatorChar); 200string extension = Path.GetExtension(fileName);
Culture.cs (8)
40if (treatAsCultureNeutral || string.Equals(Path.GetFileNameWithoutExtension(parentName), 41Path.GetFileNameWithoutExtension(name), 55string baseFileNameWithCulture = Path.GetFileNameWithoutExtension(name); 58string cultureName = Path.GetExtension(baseFileNameWithCulture); 75string extension = Path.GetExtension(name); 76string baseFileName = Path.GetFileNameWithoutExtension(baseFileNameWithCulture); 77string baseFolder = Path.GetDirectoryName(name); 79info.cultureNeutralFilename = Path.Combine(baseFolder, fileName);
DebugUtils.cs (6)
43debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 109var extension = Path.GetExtension(fileName); 110var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 112var fullPath = Path.Combine(DebugPath, fileName); 118fullPath = Path.Combine(DebugPath, fileName);
DownloadFile.cs (2)
180var destinationFile = new FileInfo(Path.Combine(destinationDirectory.FullName, filename)); 327?? Path.GetFileName(response.RequestMessage.RequestUri.LocalPath); // Otherwise attempt to get a file name from the URI
ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileIO\WriteLinesToFile.cs (1)
98var directoryPath = Path.GetDirectoryName(FileUtilities.NormalizePath(File.ItemSpec));
FileMatcher.cs (11)
29private static readonly string s_directorySeparator = new string(Path.DirectorySeparatorChar, 1); 52private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 293Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 500longPath = Path.Combine(longPath, parts[i]); 527longParts[i - startingElement] = Path.GetFileName(longPath); 694return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1653return IsMatch(Path.GetFileName(path), pattern); 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 1989var filespecUnescapedFullyQualified = Path.Combine(projectDirectoryUnescaped, filespecUnescaped); 2080fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
FileUtilities.cs (36)
74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 477return NormalizePath(Path.Combine(paths)); 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 683return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FindAppConfigFile.cs (1)
124string filename = (matchWholeItemSpec ? item.ItemSpec : Path.GetFileName(item.ItemSpec));
FindInList.cs (1)
108string filename = (MatchFileNameOnly ? Path.GetFileName(path) : path);
GenerateApplicationManifest.cs (2)
234name = Path.GetFileName(item.ItemSpec); 394manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateDeploymentManifest.cs (1)
136manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateLauncher.cs (4)
54LauncherPath = Path.Combine( 67string entryPointFileName = Path.GetFileName(EntryPoint.ItemSpec); 101OutputEntryPoint = new TaskItem(Path.Combine(Path.GetDirectoryName(EntryPoint.ItemSpec), results.KeyFile));
GenerateManifestBase.cs (5)
183name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application"; 542file.TargetPath = Path.IsPathRooted(file.SourcePath) || file.SourcePath.StartsWith("..", StringComparison.Ordinal) ? Path.GetFileName(file.SourcePath) : file.SourcePath; 593string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec); 633Util.WriteLog(String.Format(CultureInfo.CurrentCulture, "Total time to generate manifest '{1}': t={0}", Environment.TickCount - _startTime, Path.GetFileName(OutputManifest.ItemSpec)));
GenerateResource.cs (16)
570commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe")); 1522string extension = Path.GetExtension(sourceFilePath); 2066OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources")); 2545_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec)); 2675string priDirectory = Path.Combine(outFileOrDir ?? String.Empty, 2677currentOutputDirectory = Path.Combine(priDirectory, 2685currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath); 2832return Path.GetFullPath(currentOutputFile); 2843currentOutputFile = Path.GetFullPath(currentOutputFile); 2853string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty); 2858currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath); 2863currentOutputFile = Path.GetFullPath(currentOutputFile); 2914extension = Path.GetExtension(filename); 2944_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename); 3438_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile); 3503return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation); 513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation); 514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml"); 553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase)) 578string fileExtension = Path.GetExtension(file); 630string targetPath = Path.Combine(targetPathRoot, relativeToBase); 731FileName = Path.GetFileNameWithoutExtension(assemblyLocation); 960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture))); 1030group reference by Path.GetDirectoryName(reference); 1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture))); 1165string redistPath = Path.Combine(sdkRoot, "Redist"); 1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture); 61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture); 62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral"); 63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
LC.cs (1)
170outputPath = Path.Combine(OutputDirectory, outputPath);
ListOperators\FindUnderPath.cs (2)
62System.IO.Path.GetFullPath(FileUtilities.FixFilePath(Path.ItemSpec))); 83System.IO.Path.GetFullPath(FileUtilities.FixFilePath(item.ItemSpec)));
ManifestUtil\ApplicationManifest.cs (7)
433string outputFileName = Path.GetFileName(SourcePath); 631Path.GetFileNameWithoutExtension(assembly.TargetPath), 634OutputMessages.AddErrorMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath)); 739OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 750OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 760OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 767OutputMessages.AddWarningMessage("GenerateManifest.UnmanagedCodePermission", Path.GetFileNameWithoutExtension(path));
ManifestUtil\AssemblyIdentity.cs (2)
518string path = Path.Combine(searchPath, file); 525path = Path.Combine(searchPath, file);
ManifestUtil\AssemblyReferenceCollection.cs (1)
134String.Equals(identity.Name, System.IO.Path.GetFileNameWithoutExtension(a.SourcePath), StringComparison.OrdinalIgnoreCase))
ManifestUtil\BaseReference.cs (2)
54if (!Path.IsPathRooted(path)) 59return Path.GetFileName(path);
ManifestUtil\DeployManifest.cs (4)
181string redistListPath = Path.Combine(referenceAssemblyPath, _redistListFolder); 182return Path.Combine(redistListPath, _redistListFile); 581manifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
ManifestUtil\LauncherBuilder.cs (3)
37string launcherFilename = Path.GetFileName(LauncherPath); 56string strOutputExe = System.IO.Path.Combine(outputPath, launcherFilename); 91EnsureFolderExists(Path.GetDirectoryName(strOutputExe));
ManifestUtil\Manifest.cs (14)
216defaultDir = Path.GetDirectoryName(_sourcePath); 219if (!Path.IsPathRooted(defaultDir)) 221defaultDir = Path.Combine(Directory.GetCurrentDirectory(), defaultDir); 313if (Path.IsPathRooted(path)) 330string resolvedPath = Path.Combine(searchPath, path); 331resolvedPath = Path.GetFullPath(resolvedPath); 513string fileName = Path.GetFileName(f.ResolvedPath); 519f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), f.TargetPath); 523f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), AssemblyName); 541f.TargetPath = BaseReference.GetDefaultTargetPath(Path.GetFileName(f.ResolvedPath)); 651Path.GetFileNameWithoutExtension(assembly.TargetPath), 654OutputMessages.AddWarningMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath));
ManifestUtil\ManifestReader.cs (2)
27string manifestFileName = Path.GetFileName(path); 97Util.WriteLogFile(Path.GetFileNameWithoutExtension(path) + ".embedded.xml", m);
ManifestUtil\ManifestWriter.cs (1)
134File.Copy(temp, Path.Combine(Util.logPath, n + ".trust-file.xml"), true);
ManifestUtil\PathUtil.cs (10)
19path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 20path = path.TrimEnd(Path.DirectorySeparatorChar); 34path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 35path = path.TrimEnd(Path.DirectorySeparatorChar); 77if (String.Equals(Path.GetExtension(path), ".application", StringComparison.Ordinal)) 82if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 152if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 229return Path.GetFullPath(path); // make sure it's a full path
ManifestUtil\SecurityUtil.cs (5)
721string clrDllDir = Path.Combine( 728hModule = NativeMethods.LoadLibraryExW(Path.Combine(clrDllDir, "clr.dll"), IntPtr.Zero, NativeMethods.LOAD_LIBRARY_AS_DATAFILE); 865toolPath = Path.Combine(pathToDotNetFrameworkSdk, "bin", ToolName); 874toolPath = Path.Combine(Directory.GetCurrentDirectory(), ToolName); 939return versionIndependentToolPath != null ? Path.Combine(versionIndependentToolPath, toolName) : null;
ManifestUtil\Util.cs (6)
134return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 283string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\VisualStudio\8.0\VSPLOG"); 444key = Path.GetFullPath(item.ItemSpec).ToUpperInvariant(); 492s_logFileWriter = new StreamWriter(Path.Combine(logPath, "Microsoft.Build.Tasks.log"), false); 523string path = Path.Combine(logPath, filename); 553string path = Path.Combine(logPath, filename);
ManifestUtil\XmlUtil.cs (1)
152if (!uri.LocalPath.StartsWith(Path.GetTempPath(), StringComparison.Ordinal))
Modifiers.cs (9)
413modifiedItemSpec = Path.GetPathRoot(fullPath); 422modifiedItemSpec += Path.DirectorySeparatorChar; 437modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 451modifiedItemSpec = Path.GetExtension(itemSpec); 566modifiedItemSpec = Path.Combine( 617if (!Path.IsPathRooted(path)) 650return Path.GetDirectoryName(path) == null; 663fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
Move.cs (3)
133destinationFile = Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)); 233string destinationFolder = Path.GetDirectoryName(destinationFile);
MSBuild.cs (2)
510projectDirectory[i] = Path.GetDirectoryName(projectPath); 639outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
NativeMethods.cs (5)
1243private static readonly string s_gacPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, "gac"); 1382var assemblyName = Path.GetFileName(dir); 1387var versionString = Path.GetFileName(version); 1446var path = Path.Combine(s_gacPath, assemblyNameVersion.Name); 1452path = Path.Combine(
PrintLineDebugger.cs (1)
150return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
RedistList.cs (3)
305string redistDirectory = Path.Combine(frameworkDirectory, RedistListFolder); 1043string subsetDirectory = Path.Combine(frameworkDirectory, subsetListFolder); 1050string subsetFilePath = Path.Combine(subsetDirectory, subsetName + ".xml");
ResolveCodeAnalysisRuleSet.cs (5)
80if (CodeAnalysisRuleSet == Path.GetFileName(CodeAnalysisRuleSet)) 86string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet); 98string fullName = Path.Combine(directory, CodeAnalysisRuleSet); 106else if (!Path.IsPathRooted(CodeAnalysisRuleSet)) 111string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet);
ResolveKeySource.cs (1)
99keyFileExtension = Path.GetExtension(KeyFile);
ResolveManifestFiles.cs (9)
286targetPath = Path.GetFileName(item.ItemSpec); 364targetPath = Path.GetFileName(item.ItemSpec); 372targetPath = Path.Combine(itemCulture.ToString(), targetPath); 505var outputAssembliesMap = outputAssemblies.ToDictionary(p => Path.GetFullPath(p.ItemSpec), StringComparer.OrdinalIgnoreCase); 517string key = Path.GetFullPath(item.ItemSpec); 579string fileExtension = Path.GetExtension(entry.item.ItemSpec); 855fusionName = Path.Combine(destSubDir, Path.GetFileNameWithoutExtension(item.ItemSpec)); 859fusionName = Path.GetFileNameWithoutExtension(item.ItemSpec);
ResolveSDKReference.cs (1)
1011_sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");
ResourceHandling\MSBuildResXReader.cs (1)
231fileName = Path.Combine(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (8)
92private static readonly Lazy<string> ThisAssemblyDirectoryLazy = new Lazy<string>(() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName)); 554string fullPath = Path.GetFullPath(reference); 555directoriesToAddToAppDomain.Add(Path.GetDirectoryName(fullPath)); 567Path.Combine(ThisAssemblyDirectoryLazy.Value, ReferenceAssemblyDirectoryName), 570.FirstOrDefault(p => File.Exists(Path.Combine(p, assemblyFileName))); 574resolvedAssemblyReferences.Add(Path.Combine(resolvedDir, assemblyFileName)); 600path = Path.Combine(directory, name.CultureName, name.Name + ".dll"); 607path = Path.Combine(directory, name.Name + ".dll");
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (5)
37() => Path.Combine(pathToBuildTools, "Roslyn", "bincore", Path.ChangeExtension(ToolName, ".dll")), 39() => Path.Combine(pathToBuildTools, "Roslyn", Path.ChangeExtension(ToolName, ".dll")), 117if (!String.IsNullOrWhiteSpace(ToolExe) && Path.IsPathRooted(ToolExe))
SdkToolsPathUtility.cs (5)
63ProcessorArchitecture.ARM => Path.Combine(sdkToolsPath, "arm"), 64ProcessorArchitecture.AMD64 => Path.Combine(sdkToolsPath, "x64"), 65ProcessorArchitecture.IA64 => Path.Combine(sdkToolsPath, "ia64"), 68pathToTool = Path.Combine(processorSpecificToolDirectory, toolName); 75pathToTool = Path.Combine(sdkToolsPath, toolName);
SystemState.cs (8)
459string extension = Path.GetExtension(path); 464Path.GetFileNameWithoutExtension(path)); 465string filename = Path.GetFileName(path); 469string pathFromRedistList = Path.Combine(a.FrameworkDirectory, filename); 589string fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(stateFile.ToString()), relativePath)); 613instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
TempFileUtilities.cs (7)
46string basePath = Path.Combine(Path.GetTempPath(), msbuildTempFolder); 85string temporaryDirectory = Path.Combine(TempFileDirectory, "Temporary" + Guid.NewGuid().ToString("N"), subfolder ?? string.Empty); 186string file = Path.Combine(directory, $"{fileName}{extension}"); 210string destFile = Path.Combine(dest, fileInfo.Name); 215string destDir = Path.Combine(dest, subdirInfo.Name); 232: System.IO.Path.Combine(TempFileDirectory, name);
Unzip.cs (4)
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)
WindowsFileSystem.cs (3)
120var searchDirectoryPath = Path.Combine(directoryPath, "*"); 157result.Add(Path.Combine(directoryPath, findResult.CFileName)); 165Path.Combine(directoryPath, findResult.CFileName),
WriteCodeFragment.cs (3)
109if (OutputFile != null && OutputDirectory != null && !Path.IsPathRooted(OutputFile.ItemSpec)) 111OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, OutputFile.ItemSpec)); 116FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(OutputFile.ItemSpec));
Microsoft.Build.Tasks.UnitTests (1205)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (2)
27var tempPath = Path.GetTempPath(); 28_rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".UnitTest.RarCache");
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (228)
190protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 191protected static readonly string s_myProjectPath = Path.Combine(s_rootPathPrefix, "MyProject"); 193protected static readonly string s_myVersion20Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v2.0.MyVersion"); 194protected static readonly string s_myVersion40Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v4.0.MyVersion"); 195protected static readonly string s_myVersion90Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v9.0.MyVersion"); 199protected static readonly string s_myMissingAssemblyAbsPath = Path.Combine(s_rootPathPrefix, "MyProject", "MyMissingAssembly.dll"); 200protected static readonly string s_myMissingAssemblyRelPath = Path.Combine("MyProject", "MyMissingAssembly.dll"); 201protected static readonly string s_myPrivateAssemblyRelPath = Path.Combine("MyProject", "MyPrivateAssembly.exe"); 203protected static readonly string s_frameworksPath = Path.Combine(s_rootPathPrefix, "Frameworks"); 205protected static readonly string s_myComponents2RootPath = Path.Combine(s_rootPathPrefix, "MyComponents2"); 206protected static readonly string s_myComponentsRootPath = Path.Combine(s_rootPathPrefix, "MyComponents"); 207protected static readonly string s_myComponents10Path = Path.Combine(s_myComponentsRootPath, "1.0"); 208protected static readonly string s_myComponents20Path = Path.Combine(s_myComponentsRootPath, "2.0"); 209protected static readonly string s_myComponentsMiscPath = Path.Combine(s_myComponentsRootPath, "misc"); 211protected static readonly string s_myComponentsV05Path = Path.Combine(s_myComponentsRootPath, "v0.5"); 212protected static readonly string s_myComponentsV10Path = Path.Combine(s_myComponentsRootPath, "v1.0"); 213protected static readonly string s_myComponentsV20Path = Path.Combine(s_myComponentsRootPath, "v2.0"); 214protected static readonly string s_myComponentsV30Path = Path.Combine(s_myComponentsRootPath, "v3.0"); 216protected static readonly string s_unifyMeDll_V05Path = Path.Combine(s_myComponentsV05Path, "UnifyMe.dll"); 217protected static readonly string s_unifyMeDll_V10Path = Path.Combine(s_myComponentsV10Path, "UnifyMe.dll"); 218protected static readonly string s_unifyMeDll_V20Path = Path.Combine(s_myComponentsV20Path, "UnifyMe.dll"); 219protected static readonly string s_unifyMeDll_V30Path = Path.Combine(s_myComponentsV30Path, "UnifyMe.dll"); 221protected static readonly string s_myComponents40ComponentPath = Path.Combine(s_myComponentsRootPath, "4.0Component"); 222protected static readonly string s_40ComponentDependsOnOnlyv4AssembliesDllPath = Path.Combine(s_myComponents40ComponentPath, "DependsOnOnlyv4Assemblies.dll"); 224protected static readonly string s_myLibrariesRootPath = Path.Combine(s_rootPathPrefix, "MyLibraries"); 225protected static readonly string s_myLibraries_V1Path = Path.Combine(s_myLibrariesRootPath, "v1"); 226protected static readonly string s_myLibraries_V2Path = Path.Combine(s_myLibrariesRootPath, "v2"); 227protected static readonly string s_myLibraries_V1_EPath = Path.Combine(s_myLibraries_V1Path, "E"); 229protected static readonly string s_myLibraries_ADllPath = Path.Combine(s_myLibrariesRootPath, "A.dll"); 230protected static readonly string s_myLibraries_BDllPath = Path.Combine(s_myLibrariesRootPath, "B.dll"); 231protected static readonly string s_myLibraries_CDllPath = Path.Combine(s_myLibrariesRootPath, "C.dll"); 232protected static readonly string s_myLibraries_TDllPath = Path.Combine(s_myLibrariesRootPath, "T.dll"); 234protected static readonly string s_myLibraries_V1_DDllPath = Path.Combine(s_myLibraries_V1Path, "D.dll"); 235protected static readonly string s_myLibraries_V1_E_EDllPath = Path.Combine(s_myLibraries_V1_EPath, "E.dll"); 236protected static readonly string s_myLibraries_V2_DDllPath = Path.Combine(s_myLibraries_V2Path, "D.dll"); 237protected static readonly string s_myLibraries_V1_GDllPath = Path.Combine(s_myLibraries_V1Path, "G.dll"); 238protected static readonly string s_myLibraries_V2_GDllPath = Path.Combine(s_myLibraries_V2Path, "G.dll"); 240protected static readonly string s_regress454863_ADllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "A.dll"); 241protected static readonly string s_regress454863_BDllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "B.dll"); 243protected static readonly string s_regress444809RootPath = Path.Combine(s_rootPathPrefix, "Regress444809"); 244protected static readonly string s_regress444809_ADllPath = Path.Combine(s_regress444809RootPath, "A.dll"); 245protected static readonly string s_regress444809_BDllPath = Path.Combine(s_regress444809RootPath, "B.dll"); 246protected static readonly string s_regress444809_CDllPath = Path.Combine(s_regress444809RootPath, "C.dll"); 247protected static readonly string s_regress444809_DDllPath = Path.Combine(s_regress444809RootPath, "D.dll"); 249protected static readonly string s_regress444809_V2RootPath = Path.Combine(s_regress444809RootPath, "v2"); 250protected static readonly string s_regress444809_V2_ADllPath = Path.Combine(s_regress444809_V2RootPath, "A.dll"); 252protected static readonly string s_regress442570_RootPath = Path.Combine(s_rootPathPrefix, "Regress442570"); 253protected static readonly string s_regress442570_ADllPath = Path.Combine(s_regress442570_RootPath, "A.dll"); 254protected static readonly string s_regress442570_BDllPath = Path.Combine(s_regress442570_RootPath, "B.dll"); 256protected static readonly string s_myAppRootPath = Path.Combine(s_rootPathPrefix, "MyApp"); 257protected static readonly string s_myApp_V05Path = Path.Combine(s_myAppRootPath, "v0.5"); 258protected static readonly string s_myApp_V10Path = Path.Combine(s_myAppRootPath, "v1.0"); 259protected static readonly string s_myApp_V20Path = Path.Combine(s_myAppRootPath, "v2.0"); 260protected static readonly string s_myApp_V30Path = Path.Combine(s_myAppRootPath, "v3.0"); 262protected static readonly string s_netstandardLibraryDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandardlibrary.dll"); 263protected static readonly string s_netstandardDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandard.dll"); 265protected static readonly string s_portableDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "Portable.dll"); 266protected static readonly string s_systemRuntimeDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "System.Runtime.dll"); 268protected static readonly string s_dependsOnNuGet_ADllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "A.dll"); 269protected static readonly string s_dependsOnNuGet_NDllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.dll"); 270protected static readonly string s_dependsOnNuGet_NExePath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.exe"); 271protected static readonly string s_dependsOnNuGet_NWinMdPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.winmd"); 273protected static readonly string s_nugetCache_N_Lib_NDllPath = Path.Combine(s_rootPathPrefix, "NugetCache", "N", "lib", "N.dll"); 275protected static readonly string s_assemblyFolder_RootPath = Path.Combine(s_rootPathPrefix, "AssemblyFolder"); 276protected static readonly string s_assemblyFolder_SomeAssemblyDllPath = Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.dll"); 377Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), 378Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), 379Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), 380Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), 381Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), 382Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), 383Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"), 384Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"), 385Path.Combine(s_myVersion20Path, "System.Data.dll"), 386Path.Combine(s_myVersion20Path, "System.Xml.dll"), 387Path.Combine(s_myVersion20Path, "System.Xml.pdb"), 388Path.Combine(s_myVersion20Path, "System.Xml.xml"), 389Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.dll"), 390Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.pdb"), 391Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.config"), 392Path.Combine(s_myVersion20Path, "xx", "System.Xml.resources.dll"), 393Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.dll"), 394Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.pdb"), 395Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.config"), 396Path.Combine(s_rootPathPrefix, s_myPrivateAssemblyRelPath), 397Path.Combine(s_myProjectPath, "MyCopyLocalAssembly.dll"), 398Path.Combine(s_myProjectPath, "MyDontCopyLocalAssembly.dll"), 399Path.Combine(s_myVersion20Path, "BadImage.dll"), // An assembly that will give a BadImageFormatException from GetAssemblyName 400Path.Combine(s_myVersion20Path, "BadImage.pdb"), 401Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"), 402Path.Combine(s_myVersion20Path, "MyGacAssembly.pdb"), 403Path.Combine(s_myVersion20Path, "xx", "MyGacAssembly.resources.dll"), 404Path.Combine(s_myVersion20Path, "System.dll"), 405Path.Combine(s_myVersion40Path, "System.dll"), 406Path.Combine(s_myVersion90Path, "System.dll"), 407Path.Combine(s_myVersion20Path, "mscorlib.dll"), 408Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), 410Path.Combine(s_myProjectPath, "mscorlib.dll"), // This is an mscorlib.dll that has no metadata (i.e. GetAssemblyName returns null) 411Path.Combine(s_myProjectPath, "System.Data.dll"), // This is a System.Data.dll that has the wrong pkt, it shouldn't be matched. 412Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), // A vendor component that we should find in the registry. 430Path.Combine(s_myComponentsV30Path, "MyControlWithFutureTargetNDPVersion.dll"), // The future version of a component. 431Path.Combine(s_myComponentsV20Path, "MyControlWithFutureTargetNDPVersion.dll"), // The current version of a component. 432Path.Combine(s_myComponentsV10Path, "MyNDP1Control.dll"), // A control that only has an NDP 1.0 version 433Path.Combine(s_myComponentsV20Path, "MyControlWithPastTargetNDPVersion.dll"), // The current version of a component. 434Path.Combine(s_myComponentsV10Path, "MyControlWithPastTargetNDPVersion.dll"), // The past version of a component. 438Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), // A devices mscorlib. 455Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"), 503Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pdb"), 504Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.xml"), 505Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pri"), 506Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.licenses"), 507Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.config"), 516Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), 517Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), 518Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), 519Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), 520Path.Combine(s_myAppRootPath, "DependsOnWeaklyNamedUnified.dll"), 521Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), 527Path.Combine(s_myComponentsMiscPath, "DependsOnOnlyv4Assemblies.dll"), // Only depends on 4.0.0 assemblies 528Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), // Is in redist list and is a 9.0 assembly 529Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), // Depends on 9.0 assemblies 530Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), // Depends on 9.0 assemblies 531Path.Combine(s_myComponents10Path, "DependsOn9.dll"), // Depends on 9.0 assemblies 532Path.Combine(s_myComponents20Path, "DependsOn9.dll"), // Depends on 9.0 assemblies 550Path.Combine(s_myComponentsRootPath, "V.dll"), 551Path.Combine(s_myComponents2RootPath, "W.dll"), 552Path.Combine(s_myComponentsRootPath, "X.dll"), 553Path.Combine(s_myComponentsRootPath, "X.pdb"), 554Path.Combine(s_myComponentsRootPath, "Y.dll"), 555Path.Combine(s_myComponentsRootPath, "Z.dll"), 557Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), 558Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), 653string baseDir = Path.GetDirectoryName(file); 657string fileExtension = Path.GetExtension(file); 763else if (fullPath.StartsWith(@"C:\DirectoryContains", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 767else if (fullPath.StartsWith(@"C:\WinMDArchVerification", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 859if (!Path.IsPathRooted(path)) 861path = Path.GetFullPath(path); 888Path.GetTempPath() 914Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx") 923Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx") 1053if (!Path.IsPathRooted(path)) 1055path = Path.GetFullPath(path); 1077String.Equals(path, Path.Combine(s_myVersion20Path, "BadImage.dll"), StringComparison.OrdinalIgnoreCase)) 1079throw new System.BadImageFormatException(@"The format of the file '" + Path.Combine(s_myVersion20Path, "BadImage.dll") + "' is invalid"); 1084String.Equals(path, Path.Combine(s_myProjectPath, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1085|| String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1086|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 1094String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1095|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 1106if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1111if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1116if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1204if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1209if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1214if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.XML.dll"), StringComparison.OrdinalIgnoreCase)) 1221if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1228if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Data.dll"), StringComparison.OrdinalIgnoreCase)) 1234if (path.EndsWith(Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"))) 1240if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1246if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1252if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1260String.Equals(path, Path.Combine(s_myVersion20Path, "System.Data.dll"), StringComparison.OrdinalIgnoreCase)) 1301if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase)) 1306if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1321if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1326if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1331if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1382if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase)) 1388if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1394if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase)) 1399if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1404if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1439if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.pdb"), StringComparison.OrdinalIgnoreCase)) 1487if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase)) 1491if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase)) 1495if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase)) 1500if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase)) 1505if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase)) 1510if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase)) 1515if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase)) 1782string defaultName = String.Format("{0}, Version=0.0.0.0, PublicKeyToken=null, Culture=Neutral", Path.GetFileNameWithoutExtension(path)); 1824if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1828else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1832else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1836else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1840else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1844else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1859if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1867if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1875if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1997if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2093String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 2094|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 2104if (String.Equals(path, Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"), StringComparison.OrdinalIgnoreCase)) 2152if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), StringComparison.OrdinalIgnoreCase)) 2213if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnWeaklyNamedUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2221if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase)) 2229if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2237if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2245if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2253if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2277if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase)) 2287if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2297if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase)) 2305if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2313if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2346if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase)) 2354if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase)) 2359if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase)) 2367if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase)) 2372if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase)) 2380if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase)) 2385if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase)) 2393if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2402if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2411if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2988string tempPath = Path.GetTempPath(); 2989string redistListPath = Path.Combine(tempPath, Guid.NewGuid() + ".xml"); 2990string rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".RarCache");
AssemblyDependency\SuggestedRedirects.cs (2)
207warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll")))); 252warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll"))));
AssignLinkMetadata_Tests.cs (9)
21private readonly string _defaultItemSpec = Path.Combine(Path.GetTempPath(), "SubFolder", "a.cs"); 81Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link")); 108Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link")); 117ITaskItem item = GetParentedTaskItem(_defaultItemSpec, Path.Combine("SubFolder2", "SubSubFolder", "a.cs")); 138? Path.Combine("//subfolder/a.cs") 159ITaskItem item = new TaskItem(Path.Combine("SubFolder", "a.cs")); 179FullPath = Path.Combine(Path.GetTempPath(), "a.proj")
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
66string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip"); 118string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip");
CombinePath_Tests.cs (9)
28t.BasePath = Path.Combine("abc", "def"); 30string fullPath1 = Path.Combine(t.BasePath, path1); 31string path2 = Path.Combine("jkl", "mno.txt"); 32string fullPath2 = Path.Combine(t.BasePath, path2); 48t.BasePath = Path.Combine("abc", "def"); 79string path1 = Path.DirectorySeparatorChar + Path.Combine("ghi", "jkl.txt"); 80string path2 = Path.Combine("mno", "qrs.txt"); 81string fullPath2 = Path.Combine(t.BasePath, path2);
Copy_Tests.cs (87)
228Directory.Exists(Path.Combine(destinationFolder.Path, "source0")).ShouldBeTrue(); 229Directory.Exists(Path.Combine(destinationFolder.Path, "source1")).ShouldBeTrue(); 957string destinationFolder = Path.Combine(Path.GetTempPath(), "2A333ED756AF4dc392E728D0F874A398"); 958string destination1 = Path.Combine(destinationFolder, Path.GetFileName(source1)); 959string destination2 = Path.Combine(destinationFolder, Path.GetFileName(source2)); 1309string sourceFile = Path.GetTempPath(); 1358string destinationFile = Path.GetTempFileName(); 1359string sourceFile = Path.GetTempFileName(); 1527string destinationFile = Path.GetTempPath(); 1573string temp = Path.GetTempPath(); 1574string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392"); 1575string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393"); 1577string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394"); 1661string temp = Path.GetTempPath(); 1662string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 1733string file = Path.Combine(currdir, filename); 1784string temp = Path.GetTempPath(); 1785string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 1786string invalidFile = NativeMethodsShared.IsUnixLike ? Path.Combine(temp, "!@#$%^&*()|") : "!@#$%^&*()|"; 1849string temp = Path.GetTempPath(); 1850string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 1851string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 1919string sourceFileEscaped = Path.GetTempPath() + "a%253A_" + Guid.NewGuid().ToString("N") + ".txt"; 1921string temp = Path.GetTempPath(); 1922string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 1923string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 1981string tempPath = Path.GetTempPath(); 1985new TaskItem(Path.Combine(tempPath, "a.cs")), 1986new TaskItem(Path.Combine(tempPath, "b.cs")), 1987new TaskItem(Path.Combine(tempPath, "a.cs")), 1988new TaskItem(Path.Combine(tempPath, "a.cs")), 2006DestinationFolder = new TaskItem(Path.Combine(tempPath, "foo")), 2025filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Name)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true); 2038string tempPath = Path.GetTempPath(); 2042new TaskItem(Path.Combine(tempPath, "a.cs")), 2043new TaskItem(Path.Combine(tempPath, "b.cs")), 2044new TaskItem(Path.Combine(tempPath, "a.cs")), 2045new TaskItem(Path.Combine(tempPath, "a.cs")), 2046new TaskItem(Path.Combine(tempPath, "a.cs")), 2059new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs 2060new TaskItem(Path.Combine(tempPath, @"xa.cs")), // b.cs -> xa.cs should copy because it's a different source 2061new TaskItem(Path.Combine(tempPath, @"xb.cs")), // a.cs -> xb.cs should copy because it's a different destination 2062new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should copy because it's a different source from the b.cs copy done previously 2063new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should not copy because it's the same source 2092string xaPath = Path.Combine(tempPath, "xa.cs"); 2095Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[0].Key.Name); 2096Assert.Equal(Path.Combine(tempPath, "b.cs"), xaCopies[1].Key.Name); 2097Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[2].Key.Name); 2099string xbPath = Path.Combine(tempPath, "xb.cs"); 2102Assert.Equal(Path.Combine(tempPath, "a.cs"), xbCopies[0].Key.Name); 2115string temp = Path.GetTempPath(); 2116string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2117string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399"); 2118string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400"); 2553string temp = Path.GetTempPath(); 2554string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2555string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2624string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2625string destFile1 = Path.Combine(destFolder, Path.GetFileName(sourceFile1)); 2626string destFile2 = Path.Combine(destFolder, Path.GetFileName(sourceFile2)); 2631string nothingFile = Path.Combine(destFolder, "nothing.txt"); 2727string temp = Path.GetTempPath(); 2728string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2729string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2756string destLink = Path.Combine(destFolder, Path.GetFileNameWithoutExtension(sourceFile) + "." + n); 2809string temp = Path.GetTempPath(); 2810string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2811string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2875string temp = Path.GetTempPath(); 2876string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2877string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2945string destFile = Path.Combine(destFolder.Path, "The Destination"); 2989Path.Combine(Path.GetDirectoryName(sourceFile2.Path), ".", Path.GetFileName(sourceFile2.Path))) // sourceFile2.Path with a "." inserted before the file name
CreateCSharpManifestResourceName_Tests.cs (6)
424env.SetCurrentDirectory(Path.GetDirectoryName(resourceFile.Path)); 492ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 498env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 557ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 563env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 599env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path));
CreateItem_Tests.cs (5)
177ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 182ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Foo.txt")); 183ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Subdir", "Bar.txt")); 207ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 218result.ResultsByTarget["Repro"].Items[0].GetMetadata("RecursiveDir").ShouldBe("Subdir" + Path.DirectorySeparatorChar);
DirectoryBuildProjectImportTestBase.cs (2)
25private readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 177Assert.Equal(Path.Combine(ObjectModelHelpers.TempProjectDir, DirectoryBuildProjectFile), project.GetPropertyValue(DirectoryBuildProjectPathPropertyName));
DownloadFile_Tests.cs (3)
77FileInfo file = new FileInfo(Path.Combine(folder.Path, "foo.txt")); 122FileInfo file = new FileInfo(Path.Combine(folder.Path, filename)); 156FileInfo file = new FileInfo(Path.Combine(folder.Path, filename));
Exec_Tests.cs (13)
64string tempPath = Path.GetTempPath(); 122string tempPath = Path.GetTempPath(); 325string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 362string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 400string newTmp = Path.Combine(FileUtilities.TempFileDirectory, directoryWithAmpersand); 437string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 569string folder = Path.Combine(Path.GetTempPath(), includeNonAnsiInCommand ? nonAnsiCharacters : ansiCharacters); 570string command = Path.Combine(folder, "test.cmd"); 996string tempPath = Path.GetTempPath();
FileStateTests.cs (12)
96var state = new FileState(Path.GetTempPath()); 334Assert.Equal(new FileInfo(Path.GetTempPath()).Exists, new FileState(Path.GetTempPath()).FileExists); 335Assert.True(new FileState(Path.GetTempPath()).IsDirectory); 341Assert.Equal(new FileInfo(Path.GetTempPath()).IsReadOnly, new FileState(Path.GetTempPath()).IsReadOnly); 347Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTime, new FileState(Path.GetTempPath()).LastWriteTime); 353Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTimeUtc, new FileState(Path.GetTempPath()).LastWriteTimeUtcFast); 359Helpers.VerifyAssertThrowsSameWay(delegate () { var x = new FileInfo(Path.GetTempPath()).Length; }, delegate () { var x = new FileState(Path.GetTempPath()).Length; });
FormatUrl_Tests.cs (1)
78t.OutputUrl.ShouldBe(new Uri(Path.Combine(Environment.CurrentDirectory, t.InputUrl)).AbsoluteUri);
GenerateBindingRedirects_Tests.cs (1)
268TransientTestFolder testFolder = env.CreateFolder(Path.Combine(rootTestFolder.Path, "\uD873\uDD02\u9FA8\u82D8\u722B\u9EA4\u03C5\u33D1\uE038\u486B\u0033"));
GetFileHash_Tests.cs (1)
57Files = new[] { new TaskItem(Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt")) },
GetInstalledSDKLocations_Tests.cs (52)
48string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory"); 53Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0" })); 55Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0" })); 57Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" })); 59Path.Combine( 63Path.Combine( 67Path.Combine( 73Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "v1.1" })); 76Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar); 80Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar); 84Path.Combine( 91Path.Combine(new[] { tempPath, "Doors", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" })); 93Path.Combine( 99Directory.CreateDirectory(Path.Combine(tempPath, "Walls" + Path.DirectorySeparatorChar + "1.0" + Path.DirectorySeparatorChar)); 100File.WriteAllText(Path.Combine(tempPath, "Walls", "1.0", "SDKManifest.xml"), "Hello"); 116string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2"); 121Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "4.0" })); 123Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "5.0" })); 125Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "6.0" })); 127Path.Combine( 131Path.Combine( 135Path.Combine( 344Path.Combine( 346+ Path.DirectorySeparatorChar, 350Path.Combine( 352+ Path.DirectorySeparatorChar, 356Path.Combine( 358+ Path.DirectorySeparatorChar, 363Path.Combine( 365+ Path.DirectorySeparatorChar, 369Path.Combine( 371+ Path.DirectorySeparatorChar, 375Path.Combine( 377+ Path.DirectorySeparatorChar, 418Path.Combine( 420+ Path.DirectorySeparatorChar, 424Path.Combine( 426+ Path.DirectorySeparatorChar, 430Path.Combine( 432+ Path.DirectorySeparatorChar, 437Path.Combine( 439+ Path.DirectorySeparatorChar, 443Path.Combine( 445+ Path.DirectorySeparatorChar, 449Path.Combine( 451+ Path.DirectorySeparatorChar,
GetSDKReference_Tests.cs (107)
52string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies"); 53sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 54string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86"); 55string referenceAssemblyDirectoryConfigx64 = Path.Combine(sdkDirectory, "References\\Retail\\X64"); 56string referenceAssemblyDirectoryConfigNeutral = Path.Combine(sdkDirectory, "References\\Retail\\Neutral"); 57string referenceAssemblyDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\Neutral"); 58string referenceAssemblyDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X86"); 59string referenceAssemblyDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X64"); 61string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86"); 62string redistDirectoryConfigx64 = Path.Combine(sdkDirectory, "Redist\\Retail\\X64"); 63string redistDirectoryConfigNeutral = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 64string redistDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 65string redistDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X86"); 66string redistDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X64"); 68string designTimeDirectoryConfigx86 = Path.Combine(sdkDirectory, "DesignTime\\Retail\\X86"); 69string designTimeDirectoryConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\Retail\\Neutral"); 70string designTimeDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\Neutral"); 71string designTimeDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\X86"); 86Directory.CreateDirectory(Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep")); 96string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "A.winmd"); 97string testWinMD64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "A.winmd"); 98string testWinMDNeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.winmd"); 99string testWinMDNeutralWinXML = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.xml"); 100string testWinMDCommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "C.winmd"); 101string testWinMDCommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "C.winmd"); 102string testWinMDCommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "D.winmd"); 103string testWinMDCommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.winmd"); 105string testRA = Path.Combine(referenceAssemblyDirectoryConfigx86, "E.dll"); 106string testRA64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "E.dll"); 107string testRANeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "F.dll"); 108string testRACommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "G.dll"); 109string testRACommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "G.dll"); 110string testRACommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "H.dll"); 112string testRACommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.dll"); 114string redist = Path.Combine(redistDirectoryConfigx86, "A.dll"); 115string redist64 = Path.Combine(redistDirectoryConfigx64, "A.dll"); 116string redistNeutral = Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep\\B.dll"); 117string redistNeutralPri = Path.Combine(redistDirectoryConfigNeutral, "B.pri"); 118string redistCommonConfigurationx86 = Path.Combine(redistDirectoryCommonConfigX86, "C.dll"); 119string redistCommonConfigurationx64 = Path.Combine(redistDirectoryCommonConfigX64, "C.dll"); 120string redistCommonConfigurationNeutral = Path.Combine(redistDirectoryCommonConfigNeutral, "D.dll"); 121string redistCommonConfigurationNeutralDupe = Path.Combine(redistDirectoryCommonConfigNeutral, "A.dll"); 156string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies"); 157sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\AnotherSDK\\2.0\\"); 158string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86"); 159string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86"); 167string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "B.winmd"); 168string redist = Path.Combine(redistDirectoryConfigx86, "B.pri"); 169string redist2 = Path.Combine(redistDirectoryConfigx86, "B.dll"); 192private readonly string _cacheDirectory = Path.Combine(Path.GetTempPath(), "GetSDKReferenceFiles"); 301Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]); 302Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]); 307Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]); 308Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]); 313Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\X86\\"), sdkFolders[0]); 314Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[1]); 315Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\X86\\"), sdkFolders[2]); 316Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[3]); 435string winmd = Path.Combine(_sdkDirectory, "References\\Retail\\X86\\A.winmd"); 438Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true); 447Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true); 456Assert.Equal("A.winmd", Path.GetFileName(t.CopyLocalFiles[0].ItemSpec), true); 465Assert.Equal("E.dll", Path.GetFileName(t.CopyLocalFiles[5].ItemSpec), true); 474Assert.Equal("B.xml", Path.GetFileName(t.CopyLocalFiles[2].ItemSpec)); 559Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true); 568Assert.Equal("B.winmd", Path.GetFileName(t.References[1].ItemSpec), true); 577Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true); 686Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 693Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 732Assert.Equal("A.dll", Path.GetFileName(t.References[0].ItemSpec), true); 739Assert.Equal("h.dll", Path.GetFileName(t.References[4].ItemSpec), true); 828Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 837Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 880Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 889Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 965Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec)); 971Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true); 977Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[2].ItemSpec), true); 983Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[3].ItemSpec), true); 989Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[4].ItemSpec), true); 1238string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri"); 1239string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri"); 1240string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD"); 1241string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD"); 1284string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\ASubDirectory\\TwoDeep\\B.dll"); 1285string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.dll"); 1327string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri"); 1328string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri"); 1329string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD"); 1330string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD"); 1371Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec), true); 1377Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true); 1383Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[2].ItemSpec), true); 1389Assert.Equal("B.pri", Path.GetFileName(t.RedistFiles[3].ItemSpec), true); 1395Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[4].ItemSpec), true); 1401Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[5].ItemSpec), true); 1407Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[6].ItemSpec), true); 1416if (Path.GetFileName(path).Equals("C.winmd", StringComparison.OrdinalIgnoreCase)) 1421if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase)) 1423string fileName = Path.GetFileNameWithoutExtension(path); 1432if (Path.GetFileName(path).Equals("A.winmd", StringComparison.OrdinalIgnoreCase)) 1436if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 1441if (Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase))
MakeDir_Tests.cs (12)
25string temp = Path.GetTempPath(); 26string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A391"); 66string temp = Path.GetTempPath(); 67string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38e"); 68string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38f"); 70string dir2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A390"); 129string temp = Path.GetTempPath(); 130string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 175string temp = Path.GetTempPath(); 176string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 234string temp = Path.GetTempPath(); 235string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38d");
Move_Tests.cs (15)
420string temp = Path.GetTempPath(); 421string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392"); 422string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393"); 424string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394"); 595string file = Path.Combine(currdir, filename); 636string temp = Path.GetTempPath(); 637string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 681string temp = Path.GetTempPath(); 682string destFolder = Path.Combine(temp, "2A333ED756AF4d1392E728D0F864A398"); 683string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 735string temp = Path.GetTempPath(); 736string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 737string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399"); 738string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400");
MSBuild_Tests.cs (10)
48Directory.SetCurrentDirectory(Path.GetTempPath()); 50string tempPath = Path.GetTempPath(); 65string fileName = Path.GetFileName(tempProject); 73int rootLength = Path.GetPathRoot(tempPath).Length; 76projectFile1 += Path.Combine(tempPathNoRoot, fileName); 404Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "ConsoleApplication1.csproj"), $@" 444Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "Program.cs"), @" 467Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), @" 485ObjectModelHelpers.BuildTempProjectFileExpectSuccess(Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), logger); 487ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("bug'533'369", "Sub;Dir", "binaries", "ConsoleApplication1.exe"));
NativeMethodsShared_Tests.cs (2)
119string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 126nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz") + Guid.NewGuid();
NuGetPropsImportTests.cs (4)
39var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 65var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 66var nugetPropsRelativePath = Path.Combine(Path.GetDirectoryName(projectRelativePath), NuGetPropsProjectFile);
OutputPathTests.cs (5)
24private readonly string _projectRelativePath = Path.Combine("src", "test", "test.csproj"); 79var baseOutputPath = Path.Combine("build", "bin"); 115var baseOutputPath = Path.Combine("build", "bin"); 116var outputPath = Path.Combine("bin", "Debug"); 117var outputPathAlt = Path.Combine("bin", "Release");
PortableTasks_Tests.cs (5)
22private static readonly string PortableTaskFolderPath = Path.GetFullPath( 23Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 52var projFile = Path.Combine(folder, ProjectFileName); 60File.Copy(file.FullName, Path.Combine(folder, file.Name)); 61_outputHelper.WriteLine($"Copied {file.FullName} to {Path.Combine(folder, file.Name)}");
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectExtensionsImportTestBase.cs (5)
18protected readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 150string projectExtensionsDirectory = Path.Combine(ObjectModelHelpers.TempProjectDir, Path.GetDirectoryName(ImportProjectPath)); 155project.GetPropertyValue("MSBuildProjectExtensionsPath").ShouldBe($@"{projectExtensionsDirectory}{Path.DirectorySeparatorChar}"); 173<MSBuildProjectExtensionsPath>{Path.GetDirectoryName(CustomImportProjectPath)}</MSBuildProjectExtensionsPath>
ProjectExtensionsPropsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props");
ProjectExtensionsTargetsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets");
RARPrecomputedCache_Tests.cs (8)
31{ Path.Combine(standardCache.Path, "assembly1"), new SystemState.FileState(now) }, 32{ Path.Combine(standardCache.Path, "assembly2"), new SystemState.FileState(now) { Assembly = new Shared.AssemblyNameExtension("hi") } } }; 75string dllName = Path.Combine(Path.GetDirectoryName(standardCache.Path), "randomFolder", "dll.dll"); 116string dllName = Path.Combine(Path.GetDirectoryName(precomputedCache.Path), "randomFolder", "dll.dll"); 118{ Path.Combine(precomputedCache.Path, "..", "assembly1", "assembly1"), new SystemState.FileState(DateTime.Now) }, 119{ Path.Combine(precomputedCache.Path, "assembly2"), new SystemState.FileState(DateTime.Now) { Assembly = new Shared.AssemblyNameExtension("hi") } },
RegressionTests.cs (1)
58var expectedCompileItems = "a.cs;" + Path.Combine("obj", "Debug", ".NETFramework,Version=v4.8.AssemblyAttributes.cs");
ResolveCodeAnalysisRuleSet_Tests.cs (20)
78string codeAnalysisRuleSet = Path.Combine(Path.GetTempPath(), @"CodeAnalysis.ruleset"); 122string projectDirectory = Path.GetTempPath(); 128string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 150string projectDirectory = Path.GetTempPath(); 151string codeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 173var directory = Path.GetTempPath(); 179string ruleSetFullPath = Path.Combine(directory, codeAnalysisRuleSet); 201string directory = Path.GetTempPath(); 203task.CodeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 224string subdirectoryName = Path.GetRandomFileName(); 225string projectDirectory = Path.GetTempPath(); 227task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 248string subdirectoryName = Path.GetRandomFileName(); 249string codeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 250string projectDirectory = Path.GetTempPath(); 256string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 258using (new TemporaryDirectory(Path.GetDirectoryName(ruleSetFullPath))) 279string subdirectoryName = Path.GetRandomFileName(); 280task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset");
ResolveNonMSBuildProjectOutput_Tests.cs (44)
137projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 143projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 145projectOutputs, true, Path.Combine("obj", "correct.dll")); 149projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 150projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 151projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 157projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 158projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 159projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 160projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 162projectOutputs, true, Path.Combine("obj", "correct.dll")); 224projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "managed.dll")); 225projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "unmanaged.dll")); 227TestUnresolvedReferencesHelper(projectRefs, projectOutputs, path => (path == Path.Combine("obj", "managed.dll")), out unresolvedOutputs, out resolvedOutputs); 230Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "managed.dll"))); 231Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "unmanaged.dll"))); 232Assert.Equal("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "managed.dll")]).GetMetadata("ManagedAssembly")); 233Assert.NotEqual("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "unmanaged.dll")]).GetMetadata("ManagedAssembly")); 250projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 251projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 252projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 265projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 266projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 267projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 268projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 273Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 279projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 280projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 281projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 282projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 283projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "correct2.dll")); 288Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 289Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct2.dll"))); 294projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 295projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 296projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 307projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 308projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 309projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 310projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 316Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 321projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 322projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 323projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
ResolveSDKReference_Tests.cs (299)
124string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion"); 125string testDirectory = Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" }) + Path.DirectorySeparatorChar; 177string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 463string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyDependsOnWarningFromManifest"); 464string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 485string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 578string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit1"); 579string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 589string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 633string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit2"); 634string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 644string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 691string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit3"); 692string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 702string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 746string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit4"); 747string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 757string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 801string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit5"); 802string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 812string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 856string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit6"); 857string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 867string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 913string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit7"); 914string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 924string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 968string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit8"); 969string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 978string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1022string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit9"); 1023string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1033string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1492string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestWarnings"); 1493string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK", "2.0") + Path.DirectorySeparatorChar; 1499string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1551string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestErrors"); 1552string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK\\2.0\\"); 1558string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1602string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion"); 1603string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1655string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1708string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "EmptySDKManifestAttributes"); 1709string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1735string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1793string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestAttributes"); 1794string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1817string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1891string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigAndArch"); 1892string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1912string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1964string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly"); 1965string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1983string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2033string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "NoCopyOnPlatformIdentityFound"); 2034string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2048string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2100string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly"); 2101string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2121string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2174string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestOnlyHasArmLocation"); 2175string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2190string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2242string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestArmLocationWithOthers"); 2243string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2260string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2313string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistWarning"); 2314string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2331string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2385string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistError"); 2386string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2403string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2454string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureMatchesProject"); 2455string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2473string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2527string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifest"); 2528string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2547string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2592string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifestAndMetadata"); 2593string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2612string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2659string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsNotInManifest"); 2660string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2679string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2723string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsBadMetadata"); 2724string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2744string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2791string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilySameName"); 2792string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2793string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2794string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar; 2822string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2823string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 2824string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 2889string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName"); 2890string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2891string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK1", "2.0") + Path.DirectorySeparatorChar; 2892string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar; 2920string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2921string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 2922string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 2987string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName"); 2988string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2989string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK2", "2.0") + Path.DirectorySeparatorChar; 2990string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar; 2991string testDirectory4 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "4.0") + Path.DirectorySeparatorChar; 3025string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3026string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 3027string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 3028string sdkManifestFile4 = Path.Combine(testDirectory4, "SDKManifest.xml"); 3100string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameSDKName"); 3101string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 3102string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3103string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar; 3131string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3132string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 3133string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 3206string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsVerifyManifestReading"); 3207string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3227string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3280string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata"); 3281string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3301string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3357string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadataButMetadataDoesNotMatch"); 3358string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3377string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3423string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata"); 3424string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3445string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3501string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureDoesNotMatchProject"); 3502string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3521string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3565string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject"); 3566string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3584string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3637string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject"); 3639Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" }) 3640+ Path.DirectorySeparatorChar; 3658string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3705string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework"); 3706string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3707string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3708string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3709string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3710string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 3712string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\"); 3713string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64"); 3714string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral"); 3715string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64"); 3786string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 3787string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml"); 3788string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3795string redist1 = Path.Combine(archRedist, "A.dll"); 3796string redist2 = Path.Combine(neutralRedist, "B.dll"); 3797string redist3 = Path.Combine(archCommonRedist, "C.dll"); 3798string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 3799string redist5 = Path.Combine(archRedist33, "A.dll"); 3800string redist6 = Path.Combine(archCommonRedist3, "B.dll"); 3848string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework"); 3849string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3850string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3851string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3852string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3853string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 3855string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\"); 3856string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64"); 3857string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral"); 3858string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64"); 3927string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 3928string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml"); 3929string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3936string redist1 = Path.Combine(archRedist, "A.dll"); 3937string redist2 = Path.Combine(neutralRedist, "B.dll"); 3938string redist3 = Path.Combine(archCommonRedist, "C.dll"); 3939string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 3940string redist5 = Path.Combine(archRedist3, "D.dll"); 3941string redist6 = Path.Combine(archRedist33, "A.dll"); 3942string redist7 = Path.Combine(archCommonRedist3, "B.dll"); 3992string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsTargetArchitectureDoesNotExists"); 3993string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3994string x86Redist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3995string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3996string x86CommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3997string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4044string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 4045string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4051string redist1 = Path.Combine(x86CommonRedist, "A.dll"); 4052string redist2 = Path.Combine(x86Redist, "B.dll"); 4053string redist3 = Path.Combine(neutralRedist, "C.dll"); 4054string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 4101string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture"); 4102string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 4103string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 4104string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4146string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 4147string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4152string redist1 = Path.Combine(neutralRedist, "B.dll"); 4153string redist2 = Path.Combine(neutralCommonRedist, "C.dll"); 4201new Dictionary<string, ITaskItem>() { { "sdkName, Version=1.0.2", new TaskItem(Path.GetTempFileName(), new Dictionary<string, string>() { { "PlatformVersion", "1.0.2" } }) } }, 4221string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture"); 4222string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\v8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 4223string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 4224string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4285string redist1 = Path.Combine(neutralRedist, "B.dll"); 4286string redist2 = Path.Combine(neutralCommonRedist, "C.dll"); 4293string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4296string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
ResourceHandling\GenerateResource_Tests.cs (126)
75Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 77Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 114string expectedOutFile0 = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(resxFile0, ".resources")); 115string expectedOutFile1 = Path.Combine(Path.GetTempPath(), "resx1.foo.resources"); 116string expectedOutFile2 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 117string expectedOutFile3 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 163Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 165Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 212Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 248t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) }; 250Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 255t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".txt")) }; 257Assert.Equal(".txt", Path.GetExtension(t2a.FilesWritten[0].ItemSpec)); 264Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec)); 298string outputFile = Path.ChangeExtension(resourcesFile, ".txt"); 303Assert.Equal(".txt", Path.GetExtension(resourcesFile)); 335Path.GetExtension(resourceOutput).ShouldBe(".resources"); 336Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 412Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources"); 413Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 530string outputResource = Path.ChangeExtension(Path.GetFullPath(resxFile), ".resources"); 633Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources"); 634Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 748Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 750Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 800resourcesFile1 = Path.ChangeExtension(resxFile, ".resources"); 801resourcesFile2 = Path.ChangeExtension(txtFile, ".resources"); 1036t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(textFile, ".resx")) }; 1041Assert.Equal(".resx", Path.GetExtension(resourcesFile)); 1069t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) }; 1071Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 1076t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(t.FilesWritten[0].ItemSpec, ".resources")) }; 1078Assert.Equal(".resources", Path.GetExtension(t2a.FilesWritten[0].ItemSpec)); 1086Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec)); 1122Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1133Assert.Equal(".txt", Path.GetExtension(resourcesFile)); 1169string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 1171Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1173Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1176string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1232string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 1234Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1236Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1240string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1273Assert.Equal(t2.FilesWritten[2].ItemSpec, Path.ChangeExtension(t2.Sources[0].ItemSpec, ".cs")); 1311strFile = Path.ChangeExtension(resourcesFile, ".cs"); // STR filename should be generated from output not input filename 1323string stronglyTypedClassName = Path.GetFileNameWithoutExtension(resourcesFile); 1326Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1417Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1419Assert.Equal(".resources", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 1476string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".vb"); 1480Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1482Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1536Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1538Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1543string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1548Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 1594Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1596Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1601string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1606Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 1765resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources"); 1766resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources"); 1842resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources"); 1843resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources"); 1941t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resxFile, ".txt")) }; 1977Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 2051string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 2102string resourcesFile = Path.ChangeExtension(textFile, ".resources"); 2142string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2233string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 2267string outputFile = Path.ChangeExtension(t.Sources[i].ItemSpec, ".resources"); 2344File.Delete(Path.ChangeExtension(taskItem.ItemSpec, ".resources")); 2353string outputFile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources"); 2356outputFile = Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources"); 2360outputFile = Path.ChangeExtension(t.Sources[2].ItemSpec, ".resources"); 2363outputFile = Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources"); 2368Assert.Equal(t.FilesWritten[0].ItemSpec, Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources")); 2369Assert.Equal(t.FilesWritten[1].ItemSpec, Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources")); 2381Assert.Equal(t.FilesWritten[2].ItemSpec, Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources")); 2432Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.StronglyTypedFileName)); 2466File.Delete(Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs")); 2475Assert.Equal(t.StronglyTypedFileName, Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs")); 2559File.Delete(Path.ChangeExtension(textFile, ".resources")); 2577resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2653string newTextFile = Path.ChangeExtension(textFile, ".foo"); 2686string resxFile = Path.ChangeExtension(textFile, ".foo"); 2718string resxFile = Path.ChangeExtension(textFile, ".resources"); 2813File.Delete(Path.ChangeExtension(resxFile, ".resources")); 2818File.Delete(Path.ChangeExtension(resxFile2, ".resources")); 2875string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2912string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2949string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2988resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2990string csFile = Path.ChangeExtension(txtFile, ".cs"); 2994dir = Path.Combine(Path.GetTempPath(), "directory"); 3120string p2pReference = Path.Combine(ObjectModelHelpers.TempProjectDir, "bin", "debug", "lib1.dll"); 3213t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3362t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3411string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3447resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3486File.Delete(Path.ChangeExtension(resxFile, ".cs")); 3490resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3533resourcesFile = Path.ChangeExtension(resxFile, ".myresources"); 3536string resourcesFile1 = Path.ChangeExtension(resxFile1, ".myresources"); 3632Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 3634Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 3675env.CreateFolder(Path.Combine(env.DefaultTestDirectory.Path, "tmp_dir")), 3690Path.GetExtension(outputResourceFile).ShouldBe(".resources"); 4142Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "System.dll"); 4187string filename = Path.ChangeExtension(f, extension); 4240Assert.Equal(Path.GetFileNameWithoutExtension(textFile), Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 4243string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 4247Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 4251Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 4256Assert.Equal(Path.ChangeExtension(t.Sources[0].ItemSpec, codeFileExtension), t.StronglyTypedFileName); 4263string STRFile = Path.ChangeExtension(textFile, codeFileExtension); 4267Assert.Contains("class " + Path.GetFileNameWithoutExtension(textFile).ToLower(), Utilities.ReadFileContent(STRFile).ToLower());
ResourceHandling\MSBuildResXReader_Tests.cs (2)
139File.Exists(Path.Combine("ResourceHandling", "TextFile1.txt")).ShouldBeTrue("Test deployment is missing None files"); 179Path.Combine(baseDir.Path, nameof(LoadsStringFromFileRefAsStringWithShiftJISEncoding) + ".resx"),
RoslynCodeTaskFactory_Tests.cs (4)
57<Reference Include=""" + Path.Combine(Path.GetDirectoryName(location), "..", "..", "..", "Samples", "Dependency", 116string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success); 124<Reference Include=""{Path.Combine(folder.Path, "subFolder", "5106.dll")}"" />
SecurityUtil_Tests.cs (3)
22private static string TestAssembliesPaths { get; } = Path.Combine(AppContext.BaseDirectory, "TestResources"); 31string clickOnceManifest = Path.Combine(TestAssembliesPaths, "ClickOnceProfile.pubxml"); 37string pathToCertificate = Path.Combine(TestAssembliesPaths, "mycert.pfx");
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TestResources\TestBinary.cs (1)
16Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin");
Unzip_Tests.cs (17)
88_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 89_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 132_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 133_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 134_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "F83E9633685494E53BEF3794EDEEE6A6.txt"), customMessage: _mockEngine.Log); 135_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "21D6D4596067723B3AC5DF9A8B3CBFE7.txt"), customMessage: _mockEngine.Log); 136Directory.Exists(Path.Combine(destination.Path, "emptyDir")); 237SourceFiles = new ITaskItem[] { new TaskItem(Path.Combine(testEnvironment.DefaultTestDirectory.Path, "foo.zip")), } 270_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 271_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 299_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 300_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 333_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file1.js"), customMessage: _mockEngine.Log); 334_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "file1.js.map"), customMessage: _mockEngine.Log); 335_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file2.js"), customMessage: _mockEngine.Log); 336_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "readme.txt"), customMessage: _mockEngine.Log); 337_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "sub", "subfile.js"), customMessage: _mockEngine.Log);
VerifyFileHash_Tests.cs (4)
30File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"), 48File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"), 66File = Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt"), 87File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
WriteCodeFragment_Tests.cs (35)
85task.OutputDirectory = new TaskItem(Path.GetTempPath()); 90string file = Path.Combine(Path.GetTempPath(), "CombineFileDirectory.tmp"); 109string expectedFile = Path.Combine(folder.ItemSpec, file.ItemSpec); 128TaskItem file = new TaskItem(Path.Combine(env.CreateFolder(folderPath: null, createFolder: false).Path, "File.tmp")); 154string fileName = Path.GetFileName(file.Path); 176string folder = Path.Combine(Path.GetTempPath(), "foo" + Path.DirectorySeparatorChar); 177string file = Path.Combine(folder, "CombineFileDirectory.tmp"); 198string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp"); 225string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp"); 287string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp"); 326task.OutputDirectory = new TaskItem(Path.GetTempPath()); 352task.OutputDirectory = new TaskItem(Path.GetTempPath()); 378task.OutputDirectory = new TaskItem(Path.GetTempPath()); 383Assert.Equal(Path.GetTempPath(), task.OutputFile.ItemSpec.Substring(0, Path.GetTempPath().Length)); 416string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp"); 459task.OutputDirectory = new TaskItem(Path.GetTempPath()); 481task.OutputDirectory = new TaskItem(Path.GetTempPath()); 505task.OutputDirectory = new TaskItem(Path.GetTempPath()); 529task.OutputDirectory = new TaskItem(Path.GetTempPath()); 561task.OutputDirectory = new TaskItem(Path.GetTempPath()); 597task.OutputDirectory = new TaskItem(Path.GetTempPath()); 629task.OutputDirectory = new TaskItem(Path.GetTempPath()); 652task.OutputDirectory = new TaskItem(Path.GetTempPath()); 675task.OutputDirectory = new TaskItem(Path.GetTempPath()); 700task.OutputDirectory = new TaskItem(Path.GetTempPath()); 733task.OutputDirectory = new TaskItem(Path.GetTempPath()); 1078return CreateTask(language, new TaskItem(Path.GetTempPath()), null, attributes);
WriteLinesToFile_Tests.cs (1)
301var file = Path.Combine(directory.Path, $"{Guid.NewGuid().ToString("N")}.tmp");
XmlPeek_Tests.cs (3)
337string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 339xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
XmlPoke_Tests.cs (3)
333string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 335xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
XslTransformation_Tests.cs (14)
863var testingDocsDir = Path.Combine("TestDocuments", "Fdl2Proto"); 865xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(testingDocsDir, "sila.xml")) }; 866xslPath = new TaskItem(Path.Combine(testingDocsDir, "fdl2proto.xsl")); 883using (StreamReader sr = new StreamReader(Path.Combine(testingDocsDir, "expected.proto"))) 950var otherXmlPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString())); 1051var otherXslPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString() + ".xslt")); 1058var myXmlPath1 = new TaskItem(Path.Combine(dir, "a.xml")); 1065var myXmlPath2 = new TaskItem(Path.Combine(dir, "b.xml")); 1107dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 1111xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "doc.xml")) }; 1112xslPath = new TaskItem(Path.Combine(dir, "doc.xslt")); 1113xslCompiledPath = new TaskItem(Path.Combine(dir, "doc.dll")); 1114outputPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "testout.xml")) };
ZipDirectory_Tests.cs (3)
32string zipFilePath = Path.Combine(testEnvironment.CreateFolder(createFolder: true).Path, "test.zip"); 133SourceDirectory = new TaskItem(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")))
Microsoft.Build.UnitTests.Shared (49)
DummyMappedDrive.cs (4)
23_mappedPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 31File.Create(Path.Combine(_mappedPath, "x")).Dispose();
EngineTestEnvironment.cs (6)
126var projectDir = Path.GetFullPath(Path.Combine(TestRoot, relativePathFromRootToProject)); 129ProjectFile = Path.GetFullPath(Path.Combine(projectDir, projectFileName)); 197string binaryLoggerFilePath = Path.GetFullPath(Path.Combine(TestRoot, Guid.NewGuid().ToString() + ".binlog"));
EnvironmentProvider.cs (5)
51.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 65.Where(p => !Path.GetInvalidPathChars().Any(p.Contains)) 66.Select(p => Path.Combine(p, commandNameWithExtension)) 77return Path.Combine(environmentOverride, Constants.DotNet + Constants.ExeSuffix); 82if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileNameWithoutExtension(dotnetExe)
ObjectModelHelpers.cs (24)
148expectedInclude = expectedInclude.Select(i => Path.Combine(testProject.TestRoot, i)).ToArray(); 198return path.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); 580Assert.True(FileSystems.Default.FileExists(Path.Combine(TempProjectDir, fileRelativePath)), message); 734project.FullPath = Path.Combine(TempProjectDir, "Temporary" + guid.ToString("N") + ".csproj"); 838s_tempProjectDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 900string fullFilePath = Path.Combine(TempProjectDir, fileRelativePath); 901Directory.CreateDirectory(Path.GetDirectoryName(fullFilePath)); 977string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath); 1009if (string.Equals(Path.GetExtension(projectFileRelativePath), ".sln")) 1011string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath); 1606var projectDir = Path.Combine(root, relativePathFromRootToProject); 1609createdProjectFile = Path.Combine(projectDir, "build.proj"); 1619return Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 1657var fullPath = Path.Combine(pathFragments.ToArray()); 1659var directoryName = Path.GetDirectoryName(fullPath); 1830if (Path.IsPathRooted(path)) 1832splits[0] = Path.GetPathRoot(path); 1846var pathsSortedByDepth = paths.OrderByDescending(x => Path.GetDirectoryName(Path.GetFullPath(x)).Length); 1855string directory = Path.GetDirectoryName(path); 2018Path.IsPathRooted(path)
RunnerUtilities.cs (1)
68msbuildParameters = Path.Combine(binaryFolder, "MSBuild.dll") + " " + msbuildParameters;
TestEnvironment.cs (9)
142WithInvariant(new StringInvariant("Path.GetTempPath()", Path.GetTempPath)); 485files.AddRange(Directory.GetFiles(Path.GetTempPath(), MSBuildLogFiles)); 693Path = System.IO.Path.Combine(rootPath, fileName); 735return new TransientTestFolder(System.IO.Path.Combine(Path, directoryName)); 752System.IO.Path.GetFullPath(Path).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath())); 753System.IO.Path.IsPathRooted(Path).ShouldBeTrue($"{Path} is not rooted"); 806string path = System.IO.Path.Combine(destination.Path, filename);
Microsoft.Build.Utilities.Core (194)
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommandLineBuilder.cs (1)
337AppendTextWithQuoting("." + Path.DirectorySeparatorChar + fileName);
DebugUtils.cs (6)
43debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 109var extension = Path.GetExtension(fileName); 110var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 112var fullPath = Path.Combine(DebugPath, fileName); 118fullPath = Path.Combine(DebugPath, fileName);
ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileMatcher.cs (10)
29private static readonly string s_directorySeparator = new string(Path.DirectorySeparatorChar, 1); 52private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 293Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 500longPath = Path.Combine(longPath, parts[i]); 527longParts[i - startingElement] = Path.GetFileName(longPath); 694return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1965Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 1989var filespecUnescapedFullyQualified = Path.Combine(projectDirectoryUnescaped, filespecUnescaped); 2080fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
FileUtilities.cs (38)
74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 477return NormalizePath(Path.Combine(paths)); 496Path.HasExtension(uncheckedFullPath); 500return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 683return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FrameworkLocationHelper.cs (31)
410? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 420? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 430? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 440? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 450? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 460? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 470? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 480? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 557Path.DirectorySeparatorChar.ToString(), 561Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 566s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 606s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 782var frameworkPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, prefix ?? string.Empty); 792return Path.Combine(complusInstallRoot, complusVersion); 797string leaf = Path.GetFileName(currentRuntimePath); 805string baseLocation = Path.GetDirectoryName(currentRuntimePath); 921combinedPath = Path.GetFullPath(combinedPath); 929? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 930: Path.Combine(NativeMethodsShared.FrameworkBasePath, "xbuild-frameworks"); 932return Path.GetFullPath(combinedPath); 980string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 983path = Path.Combine(path, "Profile", frameworkName.Profile); 986return Path.GetFullPath(path); 1010var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1012Path.AltDirectorySeparatorChar.ToString(), 1031fixedPath += Path.DirectorySeparatorChar; 1089string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1384Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 1395(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1396!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1428frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
InprocTrackingNativeMethods.cs (1)
208string fileTrackerPath = Path.Combine(buildToolsPath, fileTrackerDllName.Value);
Modifiers.cs (9)
413modifiedItemSpec = Path.GetPathRoot(fullPath); 422modifiedItemSpec += Path.DirectorySeparatorChar; 437modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 451modifiedItemSpec = Path.GetExtension(itemSpec); 566modifiedItemSpec = Path.Combine( 617if (!Path.IsPathRooted(path)) 650return Path.GetDirectoryName(path) == null; 663fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
PlatformManifest.cs (1)
94string platformManifestPath = Path.Combine(_pathToManifest, "Platform.xml");
PrintLineDebugger.cs (1)
150return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
SDKManifest.cs (1)
311string sdkManifestPath = Path.Combine(_pathToSdk, "SDKManifest.xml");
TempFileUtilities.cs (7)
46string basePath = Path.Combine(Path.GetTempPath(), msbuildTempFolder); 85string temporaryDirectory = Path.Combine(TempFileDirectory, "Temporary" + Guid.NewGuid().ToString("N"), subfolder ?? string.Empty); 186string file = Path.Combine(directory, $"{fileName}{extension}"); 210string destFile = Path.Combine(dest, fileInfo.Name); 215string destDir = Path.Combine(dest, subdirInfo.Name); 232: System.IO.Path.Combine(TempFileDirectory, name);
ToolLocationHelper.cs (48)
659string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata"); 840propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName); 844propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion); 1034winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName); 1127string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion); 1132string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version); 1219return Path.Combine(sdkLocation, folderName); 1232? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion) 1233: Path.Combine(matchingSdk.Path, folderName); 1431var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder)); 1496string fullPath = Path.Combine(root, file); 1761if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 1835if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll"))) 1852if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 2252Path.DirectorySeparatorChar.ToString(), 2255dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar; 2420string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture); 2547string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml"); 2622string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version); 2623string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2646string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs"); 2741string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2819string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml"); 2897string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs"); 2904string defaultProgramFilesLocation = Path.Combine( 3022string platformsRoot = Path.Combine(sdk.Path, platformsFolderName); 3050string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml"); 3088string path = Path.GetFullPath(targetFrameworkDirectory); 3109string redistListFolder = Path.Combine(path, "RedistList"); 3110string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml"); 3194pathToReturn = Path.Combine(pathToReturn, includeFramework); 3195pathToReturn = Path.GetFullPath(pathToReturn); 3343pathToSdk = Path.Combine(pathToSdk, "x64"); 3346pathToSdk = Path.Combine(pathToSdk, "ia64"); 3354string filePath = Path.Combine(pathToSdk, fileName); 3470pathToSdk = Path.Combine(pathToSdk, "bin"); 3511pathToSdk = Path.Combine(pathToSdk, "x86"); 3514pathToSdk = Path.Combine(pathToSdk, "x64"); 3522string filePath = Path.Combine(pathToSdk, fileName); 3585toolPath = Path.Combine(toolPath, fileName); 3614return pathToFx == null ? null : Path.Combine(pathToFx, fileName); 3622public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName); 3850string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3903string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3904frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion); 3905frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles"); 3950string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30); 3957string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
ToolTask.cs (6)
515pathToTool = Path.Combine(ToolPath, ToolExe); 527string directory = Path.GetDirectoryName(pathToTool); 528pathToTool = Path.Combine(directory, ToolExe); 536bool isOnlyFileName = Path.GetFileName(pathToTool).Length == pathToTool.Length; 1331.Select(folderPath => Path.Combine(folderPath, filename)) 1654sb[i] = Path.DirectorySeparatorChar;
TrackedDependencies\FileTracker.cs (14)
83private static readonly string s_tempPath = Path.GetTempPath(); 99private static readonly string s_localLowApplicationDataPath = FileUtilities.EnsureTrailingSlash(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\LocalLow").ToUpperInvariant()); 118private static readonly char[] pathSeparatorArray = { Path.PathSeparator }; 121private static readonly string pathSeparator = Path.PathSeparator.ToString(); 134string defaultRootDirectory = Path.GetPathRoot(defaultCommonApplicationDataPath); 135string alternativeCommonApplicationDataPath1 = FileUtilities.EnsureTrailingSlash(Path.Combine(defaultRootDirectory, @"Documents and Settings\All Users\Application Data").ToUpperInvariant()); 142string alternativeCommonApplicationDataPath2 = FileUtilities.EnsureTrailingSlash(Path.Combine(defaultRootDirectory, @"Users\All Users\Application Data").ToUpperInvariant()); 381Environment.SetEnvironmentVariable(pathEnvironmentVariableName, Path.GetDirectoryName(fileTrackerPath) + pathSeparator + oldPath); 400string trackerPath = !Path.IsPathRooted(path) 401? Path.GetFullPath(path) 404trackerPath = Path.Combine(trackerPath, s_TrackerFilename); 504trackerPath = Path.Combine(rootPath, filename); 550string progfilesPath = Path.Combine(FrameworkLocationHelper.GenerateProgramFiles32(), 592intermediateDirectory = Path.GetDirectoryName(intermediateDirectory);
TrackedDependencies\FlatTrackingData.cs (1)
645string markerDirectory = Path.GetDirectoryName(_tlogMarker);
TrackedDependencies\TrackedDependencies.cs (2)
40string directoryName = Path.GetDirectoryName(item.ItemSpec); 41string searchPattern = Path.GetFileName(item.ItemSpec);
WindowsFileSystem.cs (3)
120var searchDirectoryPath = Path.Combine(directoryPath, "*"); 157result.Add(Path.Combine(directoryPath, findResult.CFileName)); 165Path.Combine(directoryPath, findResult.CFileName),
Microsoft.Build.Utilities.UnitTests (364)
CommandLineBuilder_Tests.cs (7)
144c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs .{Path.DirectorySeparatorChar}-Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 157c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 259c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\""); 275c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\"");
NativeMethodsShared_Tests.cs (2)
119string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 126nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz") + Guid.NewGuid();
PlatformManifest_Tests.cs (2)
69File.WriteAllText(Path.Combine(manifestDirectory, "SomeOtherFile.xml"), "hello"); 326File.WriteAllText(Path.Combine(_manifestDirectory, "Platform.xml"), ObjectModelHelpers.CleanupFileContents(contents));
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
TaskItem_Tests.cs (2)
186Path.Combine( 196from.GetMetadata(FileUtilities.ItemSpecModifiers.RootDir).ShouldBe(Path.GetPathRoot(from.GetMetadata(FileUtilities.ItemSpecModifiers.FullPath)));
TestAssemblyInfo.cs (5)
62var subdirectory = Path.GetRandomFileName(); 64string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 104string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 119string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
ToolLocationHelper_Tests.cs (334)
67string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 75string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 76string referenceDirectory = Path.Combine(tempDirectory, Path.Combine("References", "Foo", "Bar")); 81File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First"); 82File.WriteAllText(Path.Combine(referenceDirectory, "Two.winmd"), "Second"); 83File.WriteAllText(Path.Combine(referenceDirectory, "Three.winmd"), "Third"); 99string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 101string referenceDirectory = Path.Combine(tempDirectory, @"References", tempVersion, @"Foo\Bar"); 106File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First"); 134returnValue.ShouldBe(Path.Combine(sdkRootPath, @"DesignTime\CommonConfiguration\Neutral")); 160returnValue.ShouldBe(Path.Combine(sdkRootPath, "UnionMetadata")); 167string platformRootFolder = Path.Combine(Path.GetTempPath(), @"MockSDK"); 168string sdkRootFolder = Path.Combine(platformRootFolder, @"Windows Kits\10"); 169string platformFolder = Path.Combine(sdkRootFolder, @"Platforms\UAP\10.0.14944.0"); 170string platformFilePath = Path.Combine(platformFolder, "Platform.xml"); 171string sdkManifestFilePath = Path.Combine(sdkRootFolder, "SDKManifest.xml"); 212returnValue.ShouldBe(Path.Combine(sdkRootFolder, "UnionMetadata", "10.0.14944.0")); 228string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 229string sdkDirectory = Path.Combine(tempDirectory, "Foo", "Bar"); 253string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 254string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 278string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 279string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 284File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), ""); 304string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 305string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 310File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "Garbaggggge"); 332string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSFN40"); 333string temp35Directory = Path.Combine(tempDirectory, "bin"); 334string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools"); 335string toolPath = Path.Combine(temp35Directory, "MyTool.exe"); 336string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe"); 399string tempPath = Path.GetTempPath(); 400string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootNoVersions"); 401string nonVersionFolder = Path.Combine(testPath, ".UnknownFramework", "NotAVersion"); 418string tempPath = Path.GetTempPath(); 419string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootMultipleVersions"); 420string folder10 = Path.Combine(testPath, ".UnknownFramework", "v1.0"); 421string folder20 = Path.Combine(testPath, ".UnknownFramework", "v2.0"); 422string folder40 = Path.Combine(testPath, ".UnknownFramework", "v4.0"); 451string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSF40"); 452string temp35Directory = Path.Combine(tempDirectory, "bin"); 453string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools"); 454string toolPath = Path.Combine(temp35Directory, "MyTool.exe"); 455string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe"); 512Path.GetDirectoryName(typeof(object).GetTypeInfo().Module.FullyQualifiedName), 539path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86dbg")); 551Path.Combine("{runtime-base}", "v1.3.x86dbg"), // Simulate "Orcas" as the current runtime.} 556path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre")); 568Path.Combine("{runtime-base}", "v1.1.x86dbg"), // Simulate "Everett" as the current runtime. 574path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre")); 586Path.Combine(@"{runtime-base}", "v1.1"), // Simulate "everett" as the current runtime 603string tempPath = Path.GetTempPath(); 604string fakeWhidbeyPath = Path.Combine(tempPath, "v2.0.50224"); 605string fakeEverettPath = Path.Combine(tempPath, "v1.1.43225"); 692string tv12path = Path.Combine(ProjectCollection.GlobalProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion).ToolsPath, MSBuildExeName); 715string tv12path = Path.Combine(Path.GetFullPath(toolsPath32.EvaluatedValue), "msbuild.exe"); 916string pathToSdk35InstallRoot = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\"); 917string pathToSdkV4InstallRootOnVS10 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\"); 918string pathToSdkV4InstallRootOnVS11 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.0A\"); 922if (!Directory.Exists(Path.Combine(pathToSdkV4InstallRootOnVS11, "bin"))) 928string pathToSdkV4InstallRootOnVS12 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.1A\"); 936string pathToSdkV4InstallRootOnVS14 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v10.0A\"); 1273string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier); 1274expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion); 1275expectedPath = Path.Combine(expectedPath, "Profile"); 1276expectedPath = Path.Combine(expectedPath, targetFrameworkProfile); 1291string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier); 1292expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion); 1312string targetFrameworkProfile = "PocketPC" + new string(Path.GetInvalidFileNameChars()); 1331string targetFrameworkIdentifier = "Compact Framework" + new string(Path.GetInvalidFileNameChars()); 1393string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsChain"); 1395string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1396string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1397string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar; 1398string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml"); 1406string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1408string expectedChainedPath = Path.Combine(tempDirectory, "v4.0"); 1435string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude"); 1437string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1438string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1443string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1465string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude"); 1467string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1468string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1473string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1495string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoFileList"); 1497string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1498string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1503string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1524string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsBadFile"); 1526string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar; 1527string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml"); 1533string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.0")); 1555string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPointsToInvalidInclude"); 1557string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1558string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1559string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1585char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); 1591string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistInvalidPathChars"); 1593string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1594string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1595string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1625string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPathTooLong"); 1627string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1628string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1629string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1668string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootGoodWithChain"); 1670string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1") + Path.DirectorySeparatorChar; 1671string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList"); 1672string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml"); 1674string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") + Path.DirectorySeparatorChar; 1675string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1676string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1678string framework39Directory = Path.Combine(tempDirectory, "MyFramework", "v3.9") + Path.DirectorySeparatorChar; 1679string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList"); 1680string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml"); 1733string tempDirectory = Path.Combine(Path.GetTempPath(), "DisplayNameGeneration"); 1735string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") 1736+ Path.DirectorySeparatorChar; 1737string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1738string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1741Path.Combine(tempDirectory, "MyFramework", "v3.9", "Profile", "Client"); 1742string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList"); 1743string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml"); 1790string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootCircularReference"); 1792string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1") 1793+ Path.DirectorySeparatorChar; 1794string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList"); 1795string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml"); 1797string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") 1798+ Path.DirectorySeparatorChar; 1799string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1800string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1972string combinedPath = Path.Combine(programFiles32, pathToCombineWith); 1973string fullPath = Path.GetFullPath(combinedPath); 2504string rootDir = Path.Combine(env.DefaultTestDirectory.Path, "framework-root"); 2533string customFrameworkRootPath = Path.Combine(env.DefaultTestDirectory.Path, "framework-root"); 2556string rootDir = Path.Combine(env.CreateFolder().Path, "framework-root"); 2557string fallbackPath = Path.Combine(env.CreateFolder().Path, "framework-root"); 2587string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2600string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2617string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2634string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2649string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2666string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2687stdLibPaths[0].ShouldBe(Path.Combine(customFrameworkDir, frameworkName, frameworkVersionWithV) + Path.DirectorySeparatorChar, stdLibPaths[0]); 2723string redistPath = Path.Combine(rootDir, frameworkName, frameworkVersion, "RedistList"); 2724string asmPath = Path.Combine(rootDir, frameworkName, frameworkVersion); 2729File.WriteAllText(Path.Combine(redistPath, "FrameworkList.xml"), string.Format(frameworkListXml, frameworkName)); 2730File.WriteAllText(Path.Combine(asmPath, "mscorlib.dll"), string.Empty); 3004sdks["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3006sdks["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3034Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") 3035+ Path.DirectorySeparatorChar; 3130string tmpRootDirectory = Path.GetTempPath(); 3134string frameworkPath = Path.Combine(tmpRootDirectory, frameworkPathPattern); 3135string manifestFile = Path.Combine(frameworkPath, "SDKManifest.xml"); 3137string frameworkPath2 = Path.Combine(tmpRootDirectory, frameworkPathPattern2); 3138string manifestFile2 = Path.Combine(frameworkPath, "SDKManifest.xml"); 3281string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp"); 3287string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml"); 3416string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp"); 3422string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml"); 3546string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations"); 3547string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0") 3548+ Path.DirectorySeparatorChar; 3549string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0") 3550+ Path.DirectorySeparatorChar; 3578File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), "HI"); 3579File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI"); 3580string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3615string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations2"); 3616string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0") 3617+ Path.DirectorySeparatorChar; 3618string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0") 3619+ Path.DirectorySeparatorChar; 3650File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), platformSDKManifestContents); 3651File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI"); 3652string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3795targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3796targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3798targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=2.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3802targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3804targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=3.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3806targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=4.0"].ShouldBe(Path.Combine(_fakeStructureRoot2, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3816targetPlatforms[key].ExtensionSDKs["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3820targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3822targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3826targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3828targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3831targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3835targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3839targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3844targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3848targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4064targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4067targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4070targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4073targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4076targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4110string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyFindRootFolderWhereAllFilesExist"); 4111string[] rootDirectories = new string[] { Path.Combine(testDirectoryRoot, "Root1"), Path.Combine(testDirectoryRoot, "Root2") }; 4116string subdir = Path.Combine(rootDirectories[i], "Subdir"); 4119File.Create(Path.Combine(rootDirectories[i], "file1.txt")).Close(); 4120File.Create(Path.Combine(subdir, fileInSubDir)).Close(); 4420string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory"); 4425Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4427Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0")); 4429Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0")); 4431Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4432Directory.CreateDirectory(Path.Combine(tempPath, "WindowsKits", "6.0")); 4433Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "5.0")); 4435Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0")); 4437Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4439Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4440Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "1.0")); 4441Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "8.0")); 4443Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3")); 4445Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0")); 4447Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3")); 4448Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0")); 4450Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3")); 4451Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle")); 4453Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle")); 4456Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4459Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"), 4462Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0", "SDKManifest.xml"), 4466Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "SDKManifest.xml"), 4469Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4471File.WriteAllText(Path.Combine(tempPath, "Windows", "1.0", "SDKManifest.xml"), manifestPlatformSDK1); 4472File.WriteAllText(Path.Combine(tempPath, "Windows", "2.0", "SDKManifest.xml"), manifestPlatformSDK2); 4474Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0", "SDKManifest.xml"), 4476File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "3.0", "SDKManifest.xml"), manifestPlatformSDK3); 4477File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "2.0", "SDKManifest.xml"), manifestPlatformSDK4); 4479Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4482Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4484File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "1.0", "SDKManifest.xml"), manifestPlatformSDK5); 4488Path.Combine(tempPath, "MyPlatform", "8.0", "SDKManifest.xml"), 4491Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"), 4494Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0", "Platform.xml"), 4497Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3", "Platform.xml"), 4501File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "9.0", "SDKManifest.xml"), manifestPlatformSDK7); 4503Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"), 4506Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle", "Platform.xml"), 4509Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle", "Platform.xml"), 4512Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "Sparkle", "3.3.3.3")); // no platform.xml 4516Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "AnotherAssembly", "v1.1")); 4519Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar); 4523Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar); 4527Path.Combine(tempPath, "Windows", "NotAVersion", "ExtensionSDKs", "Assembly", "1.0")); 4543string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2"); 4548Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4550Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0")); 4552Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0")); 4555Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4558Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"), 4561Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0", "SDKManifest.xml"),
ToolTask_Tests.cs (10)
39_fullToolName = Path.Combine( 77protected override string ToolName => Path.GetFileName(_fullToolName); 166t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.IsWindows ? "attrib.exe" : "ps"); 387t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, shellName)); 393t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, copyName)); 438Path.Combine(systemPath, toolName)); 661env.SetEnvironmentVariable("PATH", $"{tempDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 664string directoryNamedSameAsTool = Directory.CreateDirectory(Path.Combine(tempDirectory, toolName)).FullName; 695expectedCmdPath = new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe").ToUpperInvariant() }; 990protected override string ToolName => Path.GetFileName(_pathToShell);
Microsoft.Cci.Extensions (9)
HostEnvironment.cs (9)
99string fileName = Path.GetFileName(location); 152string combinedPath = Path.Combine(libPath, assemblyPath); 199path = Path.Combine(probeDir, referencedAssembly.Name.Value + extension); 395: Path.GetDirectoryName(Path.GetFullPath(referringUnit.Location)); 482var coreAssemblyFile = contractSet.FirstOrDefault(c => Path.GetFileNameWithoutExtension(c).EndsWith(coreAssemblySimpleName, StringComparison.OrdinalIgnoreCase) == true); 749else if (Path.GetFileName(resolvedPath).Contains('*')) 756files = Directory.EnumerateFiles(Path.GetDirectoryName(resolvedPath), Path.GetFileName(resolvedPath));
Microsoft.DotNet.Arcade.Sdk (15)
src\CheckRequiredDotNetVersion.cs (1)
44var globalJsonPath = Path.Combine(RepositoryRoot, "global.json");
src\DownloadFile.cs (1)
71Directory.CreateDirectory(Path.GetDirectoryName(DestinationPath));
src\ExtractNgenMethodList.cs (2)
82var outputFileName = $"{Path.GetFileNameWithoutExtension(AssemblyFilePath)}-{outputFileNameSuffix}.ngen.txt"; 83var outputFilePath = Path.Combine(OutputDirectory, outputFileName);
src\GenerateSourcePackageSourceLinkTargetsFile.cs (4)
37Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 99return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 103=> EndsWithSeparator(path) ? path : path + Path.DirectorySeparatorChar;
src\LocateDotNet.cs (6)
45var globalJsonPath = Path.Combine(RepositoryRoot, "global.json"); 70var fileName = (Path.DirectorySeparatorChar == '\\') ? "dotnet.exe" : "dotnet"; 71var dotNetDir = paths.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(p => File.Exists(Path.Combine(p, fileName))); 73if (dotNetDir == null || !Directory.Exists(Path.Combine(dotNetDir, "sdk", sdkVersion))) 79DotNetPath = Path.GetFullPath(Path.Combine(dotNetDir, fileName));
src\SaveItems.cs (1)
45string path = Path.GetDirectoryName(File);
Microsoft.DotNet.Arcade.Sdk.Tests (23)
GenerateResxSourceTests.cs (4)
28var resx = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", "TestStrings.resx"); 29var actualFile = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 45var expectedFile = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", expectedFileName);
GenerateSourcePackageSourceLinkTargetsFileTests.cs (1)
19path.Replace('\\', Path.DirectorySeparatorChar);
GetLicenseFilePathTests.cs (3)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 20var licensePath = Path.Combine(dir, licenseFileName);
RepoWithConditionalProjectsToBuildTests.cs (1)
44var nupkgFiles = Directory.GetFiles(Path.Combine(app.WorkingDirectory, "artifacts", "packages", "Debug", "Shipping"), "*.nupkg");
Utilities\TestApp.cs (7)
23_logOutputDir = Path.Combine(logOutputDir, Path.GetFileName(workDir)); 101CopyRecursive(Path.Combine(WorkingDirectory, "artifacts", "log"), _logOutputDir); 112var destFileName = Path.Combine(destDir, srcFileName.Substring(srcDir.Length).TrimStart(new[] { Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar })); 113Directory.CreateDirectory(Path.GetDirectoryName(destFileName));
Utilities\TestProjectFixture.cs (7)
35_testAssets = Path.Combine(AppContext.BaseDirectory, "testassets"); 36_boilerPlateDir = Path.Combine(_testAssets, "boilerplate"); 41var testAppFiles = Path.Combine(_testAssets, name); 42var instanceName = Path.GetRandomFileName(); 43var tempDir = Path.Combine(Path.GetTempPath(), "arcade", instanceName); 55var pkgRoot = Path.Combine(nugetRoot, package, pkgVersion);
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
290projectFile = Path.GetFileName(projectFile);
Microsoft.DotNet.AsmDiff (8)
AssemblySet.cs (2)
81: Path.GetDirectoryName(firstLocation); 116: Path.GetDirectoryName(firstPath);
DiffCSharpWriter.cs (1)
379string appDirectory = Path.GetDirectoryName(entryAssembly.Location);
MarkdownDiffExporter.cs (5)
211? Path.GetFileName(GetFileNameForNamespace(namespaceName)) 217string directory = Path.GetDirectoryName(_path); 218string fileName = Path.GetFileNameWithoutExtension(_path); 219string extension = Path.GetExtension(_path); 220return Path.Combine(directory, fileName + "_" + namespaceName + extension);
Microsoft.DotNet.Build.Tasks.Feed (23)
src\BlobFeedAction.cs (1)
82string fileName = Path.GetFileName(item.ItemSpec);
src\BuildModelFactory.cs (1)
171string fileName = Path.GetFileName(artifact.ItemSpec);
src\common\AzureStorageUtils.cs (1)
168var fileExtension = Path.GetExtension(filePath).ToLowerInvariant();
src\common\GeneralUtils.cs (1)
195var extension = Path.GetExtension(assetId).ToUpper();
src\common\LatestLinksManager.cs (4)
82.Where(asset => !feedConfig.FilenamesToExclude.Contains(Path.GetFileName(asset))) 121Logger.LogMessage(MessageImportance.High, $" {Path.GetFileName(asset)}"); 141blobIdWithoutVersions = Path.GetFileName(blobIdWithoutVersions); 144return Path.Combine(latestLinkShortUrlPrefix, blobIdWithoutVersions).Replace("\\", "/");
src\ConfigureInputFeed.cs (1)
30string nugetConfigLocation = Path.Combine(RepoRoot, "NuGet.config");
src\PublishSignedAssets.cs (2)
73string packagesFolder = Path.Combine(assetsFolder, "packages"); 89string localPackagePath = Path.Combine(packagesFolder, $"{package.Id}.{package.Version}.nupkg");
src\PushToBuildStorage.cs (7)
167string fileName = Path.GetFileName(i.ItemSpec); 265string filename = Path.GetFileName(path); 270File.Copy(path, Path.Combine(AssetManifestsLocalStorageDir, filename), true); 277File.Copy(path, Path.Combine(ShippingPackagesLocalStorageDir, filename), true); 282File.Copy(path, Path.Combine(NonShippingPackagesLocalStorageDir, filename), true); 288string destinationPath = Path.Combine( 292Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
src\SigningInformationModelFactory.cs (5)
54var fileName = Path.GetFileName(itemToSign.ItemSpec); 55if (!blobArtifacts.Any(b => Path.GetFileName(b.Id).Equals(fileName, StringComparison.OrdinalIgnoreCase)) && 60parsedItemsToSign.Add(new ItemToSignModel { Include = Path.GetFileName(fileName) }); 68parsedStrongNameSignInfo.Add(new StrongNameSignInfoModel { Include = Path.GetFileName(signInfo.ItemSpec), CertificateName = attributes["CertificateName"], PublicKeyToken = attributes["PublicKeyToken"] }); 76var fileSignInfoModel = new FileSignInfoModel { Include = Path.GetFileName(signInfo.ItemSpec), CertificateName = attributes["CertificateName"] };
Microsoft.DotNet.Build.Tasks.Feed.Tests (43)
BuildModelFactoryTests.cs (15)
93var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 96string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 98string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 184var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 247var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 275var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 316var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 319string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 321string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 407string tempXmlFile = Path.GetTempFileName(); 558var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 588var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 697var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 713new TaskItem(Path.GetFileName(zipPath)), 714new TaskItem(Path.GetFileName(localPackagePath)),
GeneralTests.cs (3)
113var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 121var content = TestInputs.ReadAllBytes(Path.Combine("Nupkgs", $"{feedResponseContentName}.zip")); 146var testPackageName = Path.Combine("Nupkgs", "test-package-a.zip");
GenerateBuildManifestTests.cs (1)
43var manifestPath = Path.Combine("C:", "manifests", "TestManifest.xml");
PublishArtifactsInManifestTests.cs (2)
37var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV3.xml")); 92string fakeNugetExeName = $"{Path.GetRandomFileName()}.exe";
PublishToSymbolServerTest.cs (6)
160var testFile = Path.Combine("Symbols", "test.txt"); 193var testFile = Path.Combine("Symbols", "test.txt"); 236var testFile = Path.Combine("Symbols", "test.txt"); 279var testFile = Path.Combine("Symbols", "test.txt"); 319var testPackageName = Path.Combine("Symbols", "test.txt"); 346var testPackageName = Path.Combine("Symbols", "test.txt");
PushToBuildStorageTests.cs (14)
25private static string TARGET_MANIFEST_PATH = Path.Combine("C:", "manifests", "TestManifest.xml"); 26private static string PACKAGE_A = Path.Combine("C:", "packages", "test-package-a.6.0.492.nupkg"); 27private static string PACKAGE_B = Path.Combine("C:", "packages", "test-package-b.6.0.492.nupkg"); 28private static string SAMPLE_MANIFEST = Path.Combine("C:", "manifests", "SampleManifest.xml"); 150sb.Append($"<Package Id=\"{Path.GetFileNameWithoutExtension(PACKAGE_A)}\" Version=\"{NUPKG_VERSION}\" Nonshipping=\"true\" />"); 151sb.Append($"<Package Id=\"{Path.GetFileNameWithoutExtension(PACKAGE_B)}\" Version=\"{NUPKG_VERSION}\" Nonshipping=\"false\" />"); 280id: Path.GetFileNameWithoutExtension(PACKAGE_A), 284id: Path.GetFileNameWithoutExtension(PACKAGE_B), 329id: Path.GetFileNameWithoutExtension(PACKAGE_A), 333id: Path.GetFileNameWithoutExtension(PACKAGE_B), 376id: Path.GetFileNameWithoutExtension(PACKAGE_A), 380id: Path.GetFileNameWithoutExtension(PACKAGE_B), 426id: Path.GetFileNameWithoutExtension(PACKAGE_A), 430id: Path.GetFileNameWithoutExtension(PACKAGE_B),
TestInputs.cs (2)
12return Path.Combine( 13Path.GetDirectoryName(typeof(TestInputs).Assembly.Location),
Microsoft.DotNet.Build.Tasks.Installers (37)
src\BuildFPMToolPreReqs.cs (9)
75string changelogFile = Path.Combine(InputDir, "templates", "changelog"); 103string copyrightFile = Path.Combine(InputDir, "templates", "copyright"); 216parameters.Add(string.Concat("--rpm-changelog ", EscapeArg(Path.Combine(InputDir, "templates", "changelog")))); // Changelog File 221parameters.Add(string.Concat("-p ", Path.Combine(OutputDir, configJson.Package_Name + ".rpm"))); 223if (configJson.After_Install_Source != null) parameters.Add(string.Concat("--after-install ", Path.Combine(InputDir, EscapeArg(configJson.After_Install_Source)))); 224if (configJson.After_Remove_Source != null) parameters.Add(string.Concat("--after-remove ", Path.Combine(InputDir, EscapeArg(configJson.After_Remove_Source)))); 231if (configJson.Install_Root != null) parameters.Add(string.Concat(Path.Combine(InputDir, "package_root/="), configJson.Install_Root)); // Package Files 232if (configJson.Install_Man != null) parameters.Add(string.Concat(Path.Combine(InputDir, "docs", "host/="), configJson.Install_Man)); // Man Pages 233if (configJson.Install_Doc != null) parameters.Add(string.Concat(Path.Combine(InputDir, "templates", "copyright="), configJson.Install_Doc)); // CopyRight File
src\CreateLightCommandPackageDrop.cs (8)
33string packageDropOutputFolder = Path.Combine(LightCommandWorkingDir, Path.GetFileName(InstallerFile)); 55var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(WixProjectFile)); 57commandString.Append($" -wixprojectfile {Path.GetFileName(WixProjectFile)}"); 61commandString.Append($" -contentsfile {Path.GetFileName(ContentsFile)}"); 65commandString.Append($" -outputsfile {Path.GetFileName(OutputsFile)}"); 69commandString.Append($" -builtoutputsfile {Path.GetFileName(BuiltOutputsFile)}");
src\CreateLitCommandPackageDrop.cs (2)
37string packageDropOutputFolder = Path.Combine(LitCommandWorkingDir, Path.GetFileName(InstallerFile));
src\CreateWixCommandPackageDropBase.cs (17)
67OutputFile = Path.Combine(OutputFolder, $"{Path.GetFileName(InstallerFile)}{_packageExtension}"); 81string commandFilename = Path.Combine(packageDropOutputFolder, $"create.cmd"); 97commandString.Append($" -out %outputfolder%{Path.GetFileName(InstallerFile)}"); 106commandString.Append($" -loc {Path.GetFileName(locItem.ItemSpec)}"); 120commandString.Append($" {Path.GetFileName(wixSrcFile.ItemSpec)}"); 144string newWixSrcFilePath = Path.Combine(packageDropOutputFolder, Path.GetFileName(wixSrcFile.ItemSpec)); 147string wixSrcFileExtension = Path.GetExtension(wixSrcFile.ItemSpec); 176var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(locItem.ItemSpec)); 283else if (!Path.IsPathRooted(oldPath)) 292var possiblePath = Path.Combine(additionalBasePath.ItemSpec, oldPath); 310newRelativePath = Path.Combine(id, Path.GetFileName(oldPath)); 325string newFolder = Path.Combine(outputPath, id); 331File.Copy(oldPath, Path.Combine(outputPath, newRelativePath), true);
src\GenerateJsonObjectString.cs (1)
98Directory.CreateDirectory(Path.GetDirectoryName(TargetFile));
Microsoft.DotNet.Build.Tasks.Packaging (68)
CreateTrimDependencyGroups.cs (2)
163string fileName = Path.GetFileName(compileAsset); 165if (!runtimeAssets.Any(r => Path.GetFileName(r).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
GenerateNuSpec.cs (3)
119var directory = Path.GetDirectoryName(OutputFileName); 262Target = f.GetMetadata(Metadata.FileTarget).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar),
GenerateRuntimeDependencies.cs (1)
138string destRuntimeFileDir = Path.GetDirectoryName(destRuntimeFilePath);
GetApplicableAssetsFromPackages.cs (3)
207string pdbPath = Path.ChangeExtension(packageItem.SourcePath, ".pdb"); 210var pdbItem = new TaskItem(Path.ChangeExtension(packageItem.OriginalItem.ItemSpec, ".pdb")); 216pdbItem.SetMetadata("TargetPath", Path.ChangeExtension(packageItem.TargetPath, ".pdb"));
GetLayoutFiles.cs (5)
128var destination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(source)); 137var symbolSource = Path.ChangeExtension(source, symbolExtension); 142var symbolDestination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(symbolSource));
HarvestPackage.cs (11)
252version = VersionUtility.GetAssemblyVersion(Path.Combine(packagePath, refAssm))?.ToString() ?? version; 327harvestPackagePath = remappedTargetPath + '/' + Path.GetFileName(packageFile); 339targetPaths.Add(additionalTargetPath + '/' + Path.GetFileName(packageFile)); 406if (livePackageFiles.TryGetValue(Path.ChangeExtension(livePackagePath, ".pdb"), out livePdbFile)) 429var targetPath = Path.GetDirectoryName(livePackagePath).Replace('\\', '/'); 472var candidateFolder = Path.Combine(packageFolder, packageId, packageVersion); 480candidateFolder = Path.Combine(packageFolder, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant()); 544probePath = NormalizePath(Path.GetDirectoryName(probePath))) 561probePath = NormalizePath(Path.GetDirectoryName(probePath))) 580var parts = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
NuGetAssetResolver.cs (2)
105int dirLength = contentItem.Path.LastIndexOf(Path.AltDirectorySeparatorChar); 151return Path.GetFileName(path) == PlaceHolderFile;
NuGetPack.cs (13)
23@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 24@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 31@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 32@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 198string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 249return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}"); 254bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension); 259string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 296var directory = Path.GetDirectoryName(nupkgPath); 353if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "") 355string packedPackageSourcePath = Path.Combine(Path.GetDirectoryName(fileName), string.Join(".", _packageNamePrefix, Path.GetFileName(fileName)));
PackageIndex.cs (4)
71result.IndexSources.Add(Path.GetFullPath(packageIndexFile)); 78string directory = Path.GetDirectoryName(path); 194var assemblyName = Path.GetFileNameWithoutExtension(file); 205string targetFrameworkMoniker = Path.GetFileName(frameworkDir);
PackageItem.cs (5)
31IsDll = Path.GetExtension(SourcePath).Equals(".dll", StringComparison.OrdinalIgnoreCase); 48string sourceFile = Path.GetFileName(SourcePath); 49if (!Path.GetExtension(TargetPath).Equals(Path.GetExtension(sourceFile), StringComparison.OrdinalIgnoreCase) || 52TargetPath = Path.Combine(TargetPath, sourceFile);
PackageReport.cs (1)
34string directory = Path.GetDirectoryName(path);
src\Common\Internal\AssemblyResolver.cs (5)
46probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 58probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 68probingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
UpdatePackageIndex.cs (7)
121.Select(nuspec => Path.GetDirectoryName(nuspec)); 210var version = NuGetVersion.Parse(Path.GetFileName(path)); 211var id = Path.GetFileName(Path.GetDirectoryName(path)); 221var dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct(); 244var dlls = reader.GetFiles().Where(f => Path.GetExtension(f).Equals(".dll", StringComparison.OrdinalIgnoreCase)); 257dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct().ToArray();
ValidateFrameworkPackage.cs (2)
41var testAssetsByName = testAssets.Where(a => Path.GetExtension(a.PackagePath) == ".dll") 42.ToDictionary(a => Path.GetFileNameWithoutExtension(a.PackagePath), a => a);
ValidatePackage.cs (4)
328string fileName = Path.GetFileName(implementationAssembly.PackagePath); 344Path.GetFileName(i.PackagePath).Equals(fileName, StringComparison.OrdinalIgnoreCase) && 437var moduleNames = allDlls.Select(d => Path.GetFileNameWithoutExtension(d.LocalPath)); 450return !String.IsNullOrWhiteSpace(path) && Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Tasks.Packaging.Tests (5)
HarvestPackageTests.cs (5)
65candidate != Path.GetPathRoot(candidate); 66candidate = Path.GetDirectoryName(candidate)) 68string packagesCandidate = Path.Combine(candidate, "packages"); 70string packageFolder = Path.Combine(packagesCandidate, packageId, packageVersion); 71string packageFolderLower = Path.Combine(packagesCandidate, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant());
Microsoft.DotNet.Build.Tasks.Templating (2)
GenerateFileFromTemplate.cs (2)
59ResolvedOutputPath = Path.GetFullPath(OutputPath.Replace('\\', '/')); 71Directory.CreateDirectory(Path.GetDirectoryName(ResolvedOutputPath));
Microsoft.DotNet.Build.Tasks.Templating.Tests (11)
GenerateFileFromTemplateTests.cs (11)
16string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 17string filePath = Path.Combine(tempDir, "Directory.Build.props"); 43string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 44string filePath = Path.Combine(tempDir, "Directory.Build.props"); 68string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 69string filePath = Path.Combine(tempDir, "Directory.Build.props"); 90return Path.Combine( 91Path.GetDirectoryName(typeof(GenerateFileFromTemplateTests).Assembly.Location),
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
OptProf\GenerateTrainingInputFiles.cs (6)
81string vsixFilePath = Path.Combine(InsertionDirectory, product.Name); 118var configurationsDir = Path.Combine(OutputDirectory, test.Container, "Configurations"); 123WriteEntries(ibcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 133WriteEntries(filteredIbcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 147string basePath = Path.Combine(outDir, entry.RelativeDirectoryPath.Replace("\\", "") + Path.GetFileNameWithoutExtension(entry.RelativeInstallationPath));
OptProf\GenerateTrainingPropsFile.cs (1)
52var outputFilePath = Path.Combine(OutputDirectory, outputFileNameNoExt + ".props");
OptProf\IbcEntry.cs (4)
48ngenApplicationPath: Path.Combine(VSInstallationRootVar, args.InstrumentationExecutable.Replace("/", "\\"))); 59string ext = Path.GetExtension(filePath); 65=> Path.GetFileNameWithoutExtension(filePath).EndsWith(".resources"); 80select new IbcEntry(fileName, filePath, relativeDirectoryPath: Path.GetDirectoryName(fileName), DefaultNgenApplication);
Microsoft.DotNet.Build.Tasks.VisualStudio.Tests (34)
OptProf\GenerateTrainingInputFilesTests.cs (24)
136var temp = Path.GetTempPath(); 137var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 140var configPath = Path.Combine(dir, "OptProf.json"); 143var insertionDir = Path.Combine(dir, "Insertion"); 145CreateVsix(Path.Combine(insertionDir, "Setup.vsix"), manifestContent: s_manifestJson); 147var outputDir = Path.Combine(dir, "Output"); 161Path.Combine(outputDir, @"DDRIT.RPS.CSharp"), 162Path.Combine(outputDir, @"TeamEng"), 163Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations"), 164Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging"), 165Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner"), 166Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json"), 167Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json"), 168Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\xyzMicrosoft.CodeAnalysis.0.IBC.json"), 169Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"), 170Path.Combine(outputDir, @"TeamEng\Configurations"), 171Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble"), 172Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.0.IBC.json"), 173Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"), 174Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json") 178var json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json")); 189json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json")); 200json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json")); 210json = File.ReadAllText(Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json"));
OptProf\GenerateTrainingPropsFileTests.cs (6)
15var temp = Path.GetTempPath(); 16var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 27var actual = File.ReadAllText(Path.Combine(dir, "dotnet.roslyn.props")); 43var temp = Path.GetTempPath(); 44var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 55var actual = File.ReadAllText(Path.Combine(dir, "ProfilingInputs.props"));
OptProf\GetRunSettingsSessionConfigurationTests.cs (4)
415var temp = Path.GetTempPath(); 416var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 419var configPath = Path.Combine(dir, "OptProf.json"); 422var bootstrapperPath = Path.Combine(dir, "BootstrapperInfo.json");
Microsoft.DotNet.Build.Tasks.Workloads (60)
CreateVisualStudioWorkload.wix.cs (1)
156Log.LogMessage(MessageImportance.Low, $"Setting {nameof(_supportsMachineArch)} to {manifestPackage.SupportsMachineArch} for {Path.GetFileName(manifestPackage.PackageFileName)}");
EmbeddedTemplates.cs (1)
41string destinationPath = Path.Combine(destinationFolder, destinationFilename);
Msi\MsiBase.wix.cs (4)
129CompilerOutputPath = Utils.EnsureTrailingSlash(Path.Combine(baseIntermediateOutputPath, "wixobj", metadata.Id, $"{metadata.PackageVersion}", platform)); 130WixSourceDirectory = Path.Combine(baseIntermediateOutputPath, "src", "wix", metadata.Id, $"{metadata.PackageVersion}", platform); 155string eulaRtf = Path.Combine(WixSourceDirectory, "eula.rtf"); 247NuGetPackageFiles[Path.GetFullPath(msiJsonPath)] = "\\data\\msi.json";
Msi\MsiPayloadPackageProject.wix.cs (1)
37ProjectSourceDirectory = Path.Combine(SourceDirectory, "msiPackage", platform, package.Id);
Msi\MsiProperties.wix.cs (2)
107Payload = Path.GetFileName(path), 115string msiJsonPath = Path.ChangeExtension(path, ".json");
Msi\WorkloadManifestMsi.wix.cs (11)
26protected override string BaseOutputName => Path.GetFileNameWithoutExtension(Package.PackagePath); 50string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 51string packageDataDirectory = Path.Combine(Package.DestinationDirectory, "data"); 66foreach (var file in Directory.GetFiles(packageDataDirectory).Select(f => Path.GetFullPath(f))) 68NuGetPackageFiles[file] = @"\data\extractedManifest\" + Path.GetFileName(file); 77jsonContentWxs = Path.Combine(WixSourceDirectory, "JsonContent.wxs"); 80jsonDirectory = Path.Combine(WixSourceDirectory, "json"); 83string jsonFullPath = Path.GetFullPath(Path.Combine(jsonDirectory, "WorkloadPackGroups.json")); 101NuGetPackageFiles[jsonFullPath] = @"\data\extractedManifest\" + Path.GetFileName(jsonFullPath); 157ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadPackGroupMsi.wix.cs (2)
40string packageContentWxs = Path.Combine(WixSourceDirectory, $"PackageContent.{pack.Id}.wxs"); 143string msiFileName = Path.Combine(outputPath, OutputName);
Msi\WorkloadPackMsi.wix.cs (2)
31string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 77ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadSetMsi.wix.cs (4)
20protected override string BaseOutputName => Path.GetFileNameWithoutExtension(_package.PackagePath); 32string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 33string packageDataDirectory = Path.Combine(_package.DestinationDirectory, "data"); 74ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
ProjectTemplateBase.cs (1)
62public string SourceDirectory => Path.Combine(BaseIntermediateOutputPath, "src");
Swix\ComponentSwixProject.cs (3)
39ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{component.SdkFeatureBand}", 40$"{Path.GetRandomFileName()}"); 79Path.Combine(base.GetRelativePackagePath(), "_package.json");
Swix\MsiSwixProject.wix.cs (4)
83ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{sdkFeatureBand}", Id, Platform); 104return Path.Combine(relativePath, Path.GetFileName(_msi.ItemSpec)); 115using StreamWriter msiWriter = File.CreateText(Path.Combine(ProjectSourceDirectory, "msi.swr"));
Swix\PackageGroupSwixProject.wix.cs (2)
41ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{packageGroup.SdkFeatureBand}", 42$"{Path.GetRandomFileName()}");
Swix\SwixProjectBase.cs (1)
52protected string SwixDirectory => Path.Combine(SourceDirectory, "swix");
Utils.cs (2)
47return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
VisualStudioWorkloadTaskBase.wix.cs (2)
67protected string MsiOutputPath => Path.Combine(BaseOutputPath, "msi"); 72protected string PackageRootDirectory => Path.Combine(BaseIntermediateOutputPath, "pkg");
WorkloadManifestPackage.wix.cs (3)
110string primaryManifest = Path.Combine(DestinationDirectory, "data", ManifestFileName); 111string secondaryManifest = Path.Combine(DestinationDirectory, ManifestFileName); 128return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(workloadManifestFile), File.OpenRead(workloadManifestFile), workloadManifestFile);
WorkloadPackageBase.cs (9)
203DestinationDirectory = Path.Combine(destinationBaseDirectory, $"{Identity}"); 206PackageFileName = Path.GetFileNameWithoutExtension(packagePath); 239File.Copy(PackagePath, Path.Combine(DestinationDirectory, Path.GetFileName(PackagePath)), overwrite: true); 247Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "_rels")); 248Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "package")); 250Utils.DeleteFile(Path.Combine(DestinationDirectory, ".signature.p7s")); 251Utils.DeleteFile(Path.Combine(DestinationDirectory, "[Content_Types].xml")); 252Utils.DeleteFile(Path.Combine(DestinationDirectory, $"{Id}.nuspec"));
WorkloadPackPackage.wix.cs (2)
71string sourcePackage = Path.Combine(packageSource, $"{pack.AliasTo[rid]}.{pack.Version}.nupkg"); 99yield return (Path.Combine(packageSource, $"{pack.Id}.{pack.Version}.nupkg"), CreateVisualStudioWorkload.SupportedPlatforms);
WorkloadSetPackage.wix.cs (3)
100string dataDirectory = Path.Combine(DestinationDirectory, "data"); 118if (!Path.GetFileName(file).EndsWith("workloadset.json")) 120Log?.LogWarning(string.Format(Strings.WarnNonWorkloadSetFileFound, Path.GetFileName(file)));
Microsoft.DotNet.Build.Tasks.Workloads.Tests (83)
CreateVisualStudioWorkloadSetTests.cs (7)
22string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLS"); 31new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.nupkg")) 71string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetSwixItem.ItemSpec), "msi.swr")); 82string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetPackageGroupSwixItem.ItemSpec), "packageGroup.swr"));
CreateVisualStudioWorkloadTests.cs (17)
26string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WL"); 35new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg")) 95Path.Combine(Path.GetDirectoryName( 100Path.Combine(Path.GetDirectoryName( 128string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "x64", "msi.swr")); 137string swixRootDirectory = Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200"); 144string packMsiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(pythonPackSwixItem.ItemSpec), "msi.swr")); 162string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLa64"); 171new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg")) 230Path.Combine(Path.GetDirectoryName( 250string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "arm64", "msi.swr"));
MsiTests.cs (9)
34ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg"), 35msiOutputPath: Path.Combine(MsiOutputPath, "mrec")); 46string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 49ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg")); 53ITaskItem msi604 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.4.nupkg")); 83string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 84TaskItem packageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg")); 113string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 114string packagePath = Path.Combine(TestAssetsPath, "microsoft.ios.templates.15.2.302-preview.14.122.nupkg");
PackageTests.cs (4)
20string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 22TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.300.6.0.22.nupkg")); 46string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "wls-pkg"); 48ITaskItem workloadSetPackageItem = new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.nupkg"));
SwixComponentTests.cs (27)
19public string RandomPath => Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 31string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 35string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 60string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 65string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 89string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 94string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 115string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 129string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 158string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 174string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 189string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 198return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(filename), 199File.OpenRead(Path.Combine(TestAssetsPath, filename)), filename);
SwixPackageGroupTests.cs (4)
25string destinationBaseDirectory = Path.Combine(BaseIntermediateOutputPath, destinationDirectory); 26TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, manifestPackageFilename)); 37string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(packageGroupItem.ItemSpec), "packageGroup.swr"));
SwixPackageTests.cs (5)
44string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, Path.GetRandomFileName()); 45string packagePath = Path.Combine(TestAssetsPath, $"microsoft.ios.templates.{packageVersion}.nupkg"); 62string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "msi.swr"));
TestBase.cs (10)
11public static readonly string BaseIntermediateOutputPath = Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 12public static readonly string BaseOutputPath = Path.Combine(AppContext.BaseDirectory, "bin", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 14public static readonly string MsiOutputPath = Path.Combine(BaseOutputPath, "msi"); 15public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); 17public static readonly string WixToolsetPath = Path.Combine(TestAssetsPath, "wix"); 19public static readonly string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg");
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\PinvokeAnalyzer.cs (2)
30_allowedPinvokeFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzer_", StringComparison.OrdinalIgnoreCase) >= 0); 31_exceptionFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzerExceptionList.analyzerdata", StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.DotNet.GenAPI (1)
GenAPITask.cs (1)
290return File.CreateText(Path.Combine(outFilePath, filename));
Microsoft.DotNet.GenFacades (11)
GenPartialFacadeSourceGenerator.cs (3)
37string[] distinctSeeds = seeds.Select(seed => Path.GetFullPath(seed)).Distinct().ToArray(); 38string[] seedNames = distinctSeeds.Select(seed => Path.GetFileName(seed)).ToArray(); 151AddTypeToTable(typeTable, type, Path.GetFileName(assembly));
RoslynBuildTask.cs (3)
63Assembly asm = loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{name.Name}.dll")); 73loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisCsharpName}.dll")) : 74loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisName}.dll"));
src\Common\Internal\AssemblyResolver.cs (5)
46probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 58probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 68probingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
Microsoft.DotNet.Helix.JobSender (3)
Payloads\AdhocPayload.cs (3)
21$"Names of files to upload have to be distinct. The following name repeats at least once: {Path.GetFileName(duplicateName)}", 38string name = Path.GetFileName(file); 55duplicateName = files.FirstOrDefault(file => !filesSeen.Add(Path.GetFileName(file).ToLowerInvariant()));
Microsoft.DotNet.Helix.JobSender.Tests (1)
Payloads\ArchivePayloadTests.cs (1)
19var archiveFile = Path.GetTempFileName();
Microsoft.DotNet.Helix.Sdk (20)
CommandPayload.cs (3)
23var dir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"))); 56var scriptFile = new FileInfo(Path.Combine(Directory.FullName, name));
CreateXHarnessAndroidWorkItems.cs (1)
107string apkName = Path.GetFileName(apkPath);
CreateXHarnessAppleWorkItems.cs (1)
102appFolderPath = appFolderPath.TrimEnd(Path.DirectorySeparatorChar);
CreateXUnitWorkItems.cs (1)
108string assemblyName = Path.GetFileName(targetPath);
DownloadFromResultsContainer.cs (6)
54DirectoryInfo directory = Directory.CreateDirectory(Path.Combine(OutputDirectory, JobId)); 55using (FileStream stream = File.Open(Path.Combine(directory.FullName, MetadataFile), FileMode.Create, FileAccess.Write)) 78DirectoryInfo destinationDir = Directory.CreateDirectory(Path.Combine(directoryPath, workItemName)); 83string destinationFile = Path.Combine(destinationDir.FullName, file); 87Directory.CreateDirectory(Path.Combine(destinationDir.FullName, Path.GetDirectoryName(file)));
InstallDotNetTool.cs (2)
99ToolPath = Path.Combine(DestinationPath, Name, Version); 106string versionInstallPath = Path.Combine(ToolPath, ".store", Name.ToLowerInvariant(), version);
ProvisioningProfileProvider.cs (1)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
src\Common\Internal\AssemblyResolver.cs (5)
46probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 58probingPath = Path.Combine(Path.GetDirectoryName(assemblyPath), fileName); 68probingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
Microsoft.DotNet.Helix.Sdk.Tests (4)
HelpersTests.cs (2)
48string target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") ?? Environment.GetEnvironmentVariable("TEMP"), "my-test-file-123456.snt"); 54target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_PAYLOAD"), "my-test-file-123456.snt");
InstallDotNetToolTests.cs (2)
25private static readonly string s_installedPath = Path.Combine(InstallPath, ToolName, ToolVersion); 172Path.Combine(InstallPath, ToolName, ToolVersion),
Microsoft.DotNet.NuGetRepack.Tasks (8)
src\NuGetVersionUpdater.cs (4)
66tempDirectoryOpt = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 116tempPathOpt = Path.Combine(tempDirectoryOpt, Guid.NewGuid().ToString()); 360string finalPath = Path.Combine(outDirectory, package.Id + "." + package.NewVersion + ".nupkg");
src\ReplacePackageParts.cs (3)
123string tempPackagePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 237NewPackage = Path.Combine(DestinationFolder, packageId + "." + packageVersion + ".nupkg");
src\UpdatePackageVersionTask.cs (1)
91File.WriteAllLines(Path.Combine(OutputDirectory, "PreReleaseDependencies.txt"), preReleaseDependencies.Distinct());
Microsoft.DotNet.NuGetRepack.Tests (38)
ReplacePackagePartsTests.cs (4)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 22File.WriteAllBytes(originalNupkgPath = Path.Combine(dir, TestResources.MiscPackages.NameSigned), TestResources.MiscPackages.Signed); 25File.WriteAllText(replacementFilePath = Path.Combine(dir, "Replacement.txt"), "<replacement>");
VersionUpdaterTests.cs (34)
59var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 63File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA); 64File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 65File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC); 66File.WriteAllBytes(d_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameD), TestResources.DailyBuildPackages.TestPackageD); 68var a_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameA); 69var b_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameB); 70var c_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameC); 71var d_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameD); 73var a_rel = Path.Combine(dir, TestResources.ReleasePackages.NameA); 74var b_rel = Path.Combine(dir, TestResources.ReleasePackages.NameB); 75var c_rel = Path.Combine(dir, TestResources.ReleasePackages.NameC); 76var d_rel = Path.Combine(dir, TestResources.ReleasePackages.NameD); 97var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 101File.WriteAllBytes(e_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameE), TestResources.DailyBuildPackages.TestPackageE); 102File.WriteAllBytes(f_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameF), TestResources.DailyBuildPackages.TestPackageF); 104var e_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameE); 105var f_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameF); 107var e_rel = Path.Combine(dir, TestResources.ReleasePackages.NameE); 108var f_rel = Path.Combine(dir, TestResources.ReleasePackages.NameF); 125var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 129File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA); 130File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 131File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC); 164var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 165var outputDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 169File.WriteAllBytes(dotnet_tool = Path.Combine(dir, TestResources.MiscPackages.NameDotnetTool), TestResources.MiscPackages.DotnetTool); 171File.WriteAllBytes(normal_package_b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 176Assert.Single(Directory.EnumerateFiles(outputDir), fullPath => Path.GetFileNameWithoutExtension(fullPath) == "TestPackageB.1.0.0");
Microsoft.DotNet.Open.Api.Tools.Tests (40)
OpenApiAddFileTests.cs (2)
45Assert.Contains($"The project '{Path.Combine(_tempDir.Root, csproj)}' does not exist.", _error.ToString()); 112var absolute = Path.GetFullPath(nswagJsonFile, project.Project.Dir().Root);
OpenApiAddProjectTests.cs (2)
71run = app.Execute(new[] { "add", "project", Path.Combine(csproj.Path, "..", "refProj.csproj") }); 96var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj");
OpenApiAddURLTests.cs (16)
36var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 69var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 102var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 135var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 167var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 199var firstJsonFile = Path.Combine(_tempDir.Root, firstExpectedJsonName); 227var secondJsonFile = Path.Combine(_tempDir.Root, secondExpectedJsonName); 259var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 291var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 307var run = app.Execute(new[] { "add", "url", FakeOpenApiUrl, "--output-file", Path.Combine("outputdir", "file.yaml") }); 311var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 323var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 339var outputFile = Path.Combine("outputdir", "file.yaml"); 344var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 356var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 441var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName);
OpenApiRefreshTests.cs (3)
25var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 55var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 83var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json");
OpenApiRemoveTests.cs (10)
32var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 47csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 56Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile))); 75var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 90csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 118var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj"); 124using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 138using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 177var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 186Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile)));
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
Microsoft.DotNet.PackageTesting (5)
VerifyClosure.cs (3)
100otherFiles.Add(Path.GetFileName(file)); 107var fileName = Path.GetFileName(assemblyInfo.Path); 108var existingFileName = Path.GetFileName(existingInfo.Path);
VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
Microsoft.DotNet.RemoteExecutor (16)
Program.cs (1)
104Directory.SetCurrentDirectory(Path.GetTempPath());
RemoteExecutor.cs (10)
12using IOPath = System.IO.Path; 70if (!IOPath.GetFileName(HostRunner).Equals(hostName, StringComparison.OrdinalIgnoreCase)) 72string runtimePath = IOPath.GetDirectoryName(typeof(object).Assembly.Location); 81string dotnetExe = IOPath.Combine(directory, hostName); 94HostRunnerName = IOPath.GetFileName(HostRunner); 96static string GetDirectoryName(string path) => string.IsNullOrEmpty(path) ? string.Empty : IOPath.GetDirectoryName(path); 524string tempFile = System.IO.Path.GetTempFileName(); 526string devConfigFile = System.IO.Path.ChangeExtension(configFile, "dev.json"); 643.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".runtimeconfig.json")) 648.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".deps.json"))
RemoteInvokeHandle.cs (2)
157string miniDmpPath = Path.Combine(uploadPath, $"{Process.Id}.{Path.GetRandomFileName()}.dmp");
RemoteInvokeOptions.cs (3)
37public string ExceptionFile { get; } = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Microsoft.DotNet.SharedFramework.Sdk (17)
src\CreateFrameworkListFile.cs (5)
84Filename = Path.GetFileName(item.ItemSpec), 119string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'); 171new XAttribute("Culture", Path.GetFileName(Path.GetDirectoryName(path)))); 260Directory.CreateDirectory(Path.GetDirectoryName(TargetFile));
src\FileUtilities.cs (1)
34if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
src\GeneratePlatformManifestEntriesFromTemplate.cs (2)
32var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First()); 50var entryTemplateExtension = Path.GetExtension(entryTemplate.ItemSpec);
src\GenerateSharedFrameworkDepsFile.cs (3)
62string fileName = Path.GetFileName(filePath); 68resourceAssemblies.Add(new ResourceAssembly(Path.Combine(cultureMaybe, fileName), cultureMaybe)); 115var depsFilePath = Path.Combine(IntermediateOutputPath, depsFileName);
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (3)
100otherFiles.Add(Path.GetFileName(file)); 107var fileName = Path.GetFileName(assemblyInfo.Path); 108var existingFileName = Path.GetFileName(existingInfo.Path);
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
src\ValidateFileVersions.cs (1)
30var fileName = Path.GetFileName(file.ItemSpec);
Microsoft.DotNet.SignCheck (16)
SignCheck.cs (12)
21private static readonly string _appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SignCheck"); 205string downloadPath = Path.Combine(_appData, Path.GetFileName(uriResult.LocalPath)); 212string fileSearchPath = Path.GetDirectoryName(inputFile); 213string fileSearchPattern = Path.GetFileName(inputFile); 271else if (File.Exists(Path.GetFullPath(inputFile))) 290inputFiles.Remove(Path.GetFullPath(Options.ErrorLogFile)); 295inputFiles.Remove(Path.GetFullPath(Options.LogFile)); 413Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(Options.ExclusionsOutput))); 469string downloadPath = Path.Combine(_appData, Path.GetFileName(uri.LocalPath));
SignCheckTask.cs (1)
116if (Path.IsPathRooted(checkFile))
src\Common\Internal\AssemblyResolution.cs (1)
33var fullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "System.Collections.Immutable.dll");
Utils.cs (2)
17var directoryPath = Path.GetDirectoryName(path); 18var directory = Path.GetFileName(path);
Microsoft.DotNet.SignCheckLibrary (50)
Interop\StructuredStorage.cs (3)
113string storageFullName = Path.Combine(storageDir, storageName + storageExtension); 141string path = Path.Combine(dir, (string)record["Name"]); 143if (path.IndexOfAny(Path.GetInvalidPathChars()) == -1)
Logging\FileLogger.cs (4)
35Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(messageFile))); 44Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(errorFile)));
Verification\ArchiveVerifier.cs (7)
39string directoryName = Path.GetDirectoryName(archiveEntry.FullName); 42string extension = Path.GetExtension(archiveEntry.FullName); 45string aliasFileName = String.Equals(extension.ToLowerInvariant(), ".cab") ? Path.GetFileName(archiveEntry.FullName) : 46Utils.GetHash(archiveEntry.FullName, HashAlgorithmName.SHA256.Name) + Path.GetExtension(archiveEntry.FullName); // lgtm [cs/zipslip] Archive from trusted source 47string aliasFullName = Path.Combine(tempPath, hashedPath, aliasFileName); 55CreateDirectory(Path.GetDirectoryName(aliasFullName)); 66Path.Combine(svr.VirtualPath, fullName), fullName);
Verification\AuthentiCode.cs (1)
24pcwszFilePath = Path.GetFullPath(path),
Verification\Exclusions.cs (2)
80if (IsMatch(e.FilePatterns, Path.GetFileName(containerPath)) || IsMatch(e.FilePatterns, containerPath) || IsMatch(e.FilePatterns, path) || IsMatch(e.FilePatterns, Path.GetFileName(path)) || IsMatch(e.FilePatterns, virtualPath))
Verification\ExeVerifier.cs (4)
44var payloadPath = Path.Combine(svr.VirtualPath, Path.GetFileName(file)); 45SignatureVerificationResult bundleEntryResult = VerifyFile(Path.GetFullPath(file), svr.Filename, payloadPath, Path.GetFileName(file));
Verification\FileVerifier.cs (2)
124string extension = Path.GetExtension(path); 165Log.WriteMessage(LogVerbosity.Detailed, String.Format(SignCheckResources.ProcessingFile, Path.GetFileName(path), String.IsNullOrEmpty(parent) ? SignCheckResources.NA : parent));
Verification\Jar\JarFile.cs (3)
100a => String.Equals(Path.GetExtension(a.FullName), ".SF", StringComparison.OrdinalIgnoreCase) && 181where (String.Equals(Path.GetExtension(entry.FullName), ".SF", StringComparison.OrdinalIgnoreCase) && 188string baseFilename = Path.GetFileNameWithoutExtension(file.FullName);
Verification\Jar\JarSignatureFile.cs (3)
93BaseFilename = Path.GetFileNameWithoutExtension(signatureFilename); 183if (String.Equals(Path.GetExtension(SignatureBlockFilePath), ".RSA", StringComparison.OrdinalIgnoreCase)) 188if (String.Equals(Path.GetExtension(SignatureBlockFilePath), ".DSA", StringComparison.OrdinalIgnoreCase))
Verification\LZMAUtils.cs (1)
19string destinationDir = Path.GetDirectoryName(destinationFile);
Verification\LzmaVerifier.cs (3)
30string destinationFile = Path.Combine(tempPath, Path.GetFileNameWithoutExtension(path)); 35svr.NestedResults.Add(VerifyFile(destinationFile, parent, Path.Combine(svr.VirtualPath, destinationFile), containerPath: null));
Verification\MsiVerifier.cs (5)
40string name = key + Path.GetExtension(installPackage.Files[key].TargetName); 41string targetPath = Path.Combine(svr.TempPath, name); 55SignatureVerificationResult packageFileResult = VerifyFile(installPackage.Files[key].TargetPath, svr.Filename, Path.Combine(svr.VirtualPath, originalFiles[key]), containerPath: null); 77string binaryFilePath = Path.Combine(svr.TempPath, binaryFile); 79SignatureVerificationResult binaryStreamResult = VerifyFile(binaryFilePath, svr.Filename, Path.Combine(svr.VirtualPath, binaryFile), containerPath: null);
Verification\MspVerifier.cs (1)
29svr.NestedResults.Add(VerifyFile(file, svr.Filename, Path.Combine(svr.VirtualPath, file), containerPath: null));
Verification\MsuVerifier.cs (2)
35string cabFileFullName = Path.GetFullPath(cabFile); 36SignatureVerificationResult cabEntryResult = VerifyFile(cabFile, svr.Filename, Path.Combine(svr.VirtualPath, cabFile), cabFileFullName);
Verification\SignatureVerificationManager.cs (4)
119result = fileVerifier.VerifySignature(file, parent: null, virtualPath: Path.GetFileName(file)); 174string extension = Path.GetExtension(path); 234if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "nuspec", StringComparison.OrdinalIgnoreCase))) 239else if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "vsixmanifest", StringComparison.OrdinalIgnoreCase)))
Verification\SignatureVerificationResult.cs (5)
180_tempPath = Path.Combine(Path.GetTempPath(), "SignCheck", Path.GetRandomFileName()); 194Filename = Path.GetFileName(path); 195FullPath = Path.GetFullPath(path);
Microsoft.DotNet.SignTool (55)
src\BatchSignUtil.cs (3)
154Path.GetExtension(fileInfo.FullPath) == ".exe").ToArray(); 164var workingDirectory = Path.Combine(_signTool.TempDir, "engines"); 169string engineFileName = $"{Path.Combine(workingDirectory, $"{engineContainer}", file.FileName)}{SignToolConstants.MsiEngineExtension}";
src\Configuration.cs (9)
120_pathToContainerUnpackingDirectory = Path.Combine(tempDir, "ContainerSigning"); 149var fileUniqueKey = new SignedFileContentKey(contentHash, Path.GetFileName(fullPath)); 281var extension = Path.GetExtension(file.FileName); 667Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 690var fileUniqueKey = new SignedFileContentKey(contentHash, Path.GetFileName(relativePath)); 697packages.Add(Path.GetFileName(archivePath)); 702var fileName = Path.GetFileName(relativePath); 706string tempPath = Path.Combine(_pathToContainerUnpackingDirectory, extractPathRoot, relativePath); 709Directory.CreateDirectory(Path.GetDirectoryName(tempPath));
src\FileSignInfo.cs (15)
25=> Path.GetExtension(path) == ".exe" || Path.GetExtension(path) == ".dll"; 28=> Path.GetExtension(path).Equals(".vsix", StringComparison.OrdinalIgnoreCase); 31=> Path.GetExtension(path).Equals(".mpack", StringComparison.OrdinalIgnoreCase); 34=> Path.GetExtension(path).Equals(".nupkg", StringComparison.OrdinalIgnoreCase); 40=> Path.GetExtension(path).Equals(".zip", StringComparison.OrdinalIgnoreCase); 43=> Path.GetExtension(path).EndsWith(".tgz", StringComparison.OrdinalIgnoreCase); 46=> (Path.GetExtension(path).Equals(".msi", StringComparison.OrdinalIgnoreCase) 47|| Path.GetExtension(path).Equals(".wixlib", StringComparison.OrdinalIgnoreCase)); 50=> Path.GetExtension(path).Equals(".ps1", StringComparison.OrdinalIgnoreCase) 51|| Path.GetExtension(path).Equals(".psd1", StringComparison.OrdinalIgnoreCase) 52|| Path.GetExtension(path).Equals(".psm1", StringComparison.OrdinalIgnoreCase); 85|| Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase)); 89(Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase) || 90Path.GetExtension(FileName).Equals(".msi", StringComparison.OrdinalIgnoreCase));
src\PathWithHash.cs (1)
38FileName = Path.GetFileName(fullPath);
src\SignTool.cs (14)
86var signingDir = Path.Combine(_args.TempDir, "Signing"); 87var nonOSXFilesToSign = filesToSign.Where(fsi => !SignToolConstants.SignableOSXExtensions.Contains(Path.GetExtension(fsi.FileName))); 88var osxFilesToSign = filesToSign.Where(fsi => SignToolConstants.SignableOSXExtensions.Contains(Path.GetExtension(fsi.FileName))); 97var nonOSXBuildFilePath = Path.Combine(signingDir, $"Round{round}.proj"); 101nonOSXSigningStatus = RunMSBuild(buildEngine, nonOSXBuildFilePath, Path.Combine(_args.LogDir, $"Signing{round}.binlog")); 111var osxFilesZippingDir = Path.Combine(_args.TempDir, "OSXFilesZippingDir"); 118var osxBuildFilePath = Path.Combine(signingDir, $"Round{round}-OSX-Cert{certificate}.proj"); 125File.Copy(item.FullPath, Path.Combine(osxFilesZippingDir, item.FileName), overwrite: true); 128osxSigningStatus = RunMSBuild(buildEngine, osxBuildFilePath, Path.Combine(_args.LogDir, $"Signing{round}-OSX.binlog")); 134File.Copy(Path.Combine(osxFilesZippingDir, item.FileName), item.FullPath, overwrite: true); 157AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "MicroBuild.Core.props")}"" />"); 179AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "MicroBuild.Core.targets")}"" />"); 193AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "MicroBuild.Core.props")}"" />"); 205AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "MicroBuild.Core.targets")}"" />");
src\SignToolTask.cs (6)
204if(!Path.IsPathRooted(TempDir)) 323if (!Path.IsPathRooted(itemToSign.ItemSpec)) 329var directoryParts = Path.GetFullPath(Path.GetDirectoryName(itemToSign.ItemSpec)).Split(separators); 345return string.Join(Path.DirectorySeparatorChar.ToString(), result); 375if (!extension.Equals(Path.GetExtension(extension)))
src\VerifySignatures.cs (1)
24return Path.GetFileName(filePath).Equals(".signature.p7s", StringComparison.OrdinalIgnoreCase);
src\WixPackInfo.cs (2)
33string filename = Path.GetFileName(path); 42return Path.GetFileName(path).EndsWith(WixPackExtension, StringComparison.OrdinalIgnoreCase);
src\ZipData.cs (4)
201string workingDir = Path.Combine(tempDir, "extract", workingDirGuidSegment); 202string outputDir = Path.Combine(tempDir, "output", outputDirGuidSegment); 203string createFileName = Path.Combine(workingDir, "create.cmd"); 204string outputFileName = Path.Combine(outputDir, FileSignInfo.FileName);
Microsoft.DotNet.SignTool.Tests (104)
SignToolTests.cs (104)
247_tmpDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 254return Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "wix"); 257private static string s_tarToolPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "tar", "Microsoft.Dotnet.Tar.dll"); 261var srcPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "Resources", name); 267dstDir = Path.Combine(dstDir, relativePath); 271var dstPath = Path.Combine(dstDir, name); 283var dstPath = Path.Combine(_tmpDir, name); 533<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, fileToTest))}""> 575$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 576$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 577$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 578$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''." 621$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerOne.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''." 689$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "CoreLibCrossARM.dll"))}""> 692<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "AspNetCoreCrossLib.dll"))}""> 769$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 814$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "ABCDEFG/MsiSetup.msi"))}""> 817$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines\\0\\MsiBootstrapper.exe-engine.exe"))}""> 820$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "MsiBootstrapper.exe"))}""> 823$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithWix.nupkg"))}""> 872$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 875<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 879<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 883<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 887<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 891<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 895<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 901<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 958<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 961<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 965<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 969<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 973<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 977<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 981<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 987<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 1034<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1037<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1040<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1043<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1086<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "test/NativeLibrary.dll"))}""> 1089<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "test/SOS.NETCore.dll"))}""> 1092<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1095<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1138<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1141<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1144<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1147<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1191<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1194<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1197<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1200<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1307$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiSetup.msi"))}""> 1310$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines", "0", "MsiBootstrapper.exe-engine.exe"))}""> 1313$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiBootstrapper.exe"))}""> 1355$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiApplication.exe"))}""> 1358$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiSetup.msi"))}""> 1371var badPath = Path.Combine(GetWixToolPath(), "badpath"); 1421<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "VisualStudio.Mac.Banana.dll"))}""> 1463$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 1469<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "lib/net461/ProjectOne.dll"))}""> 1473<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/netstandard2.0/ProjectOne.dll"))}""> 1477<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 1483<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix"))}""> 1488<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 1530$"{Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 1536<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 1540<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "10", "Team%20Tools/Dynamic Code Coverage/net461/ProjectOne.dll"))}""> 1544<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "11", "Team%20Tools/Dynamic Code Coverage/netstandard2.0/ProjectOne.dll"))}""> 1550<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix"))}""> 1555<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "TestSpaces.vsix"))}""> 1593<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 1597<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 1601<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 1607<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 1612<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 1658$"{Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "B", "PackageWithRelationships.vsix")}" 1664<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 1668<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 1672<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 1678<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix"))}""> 1683<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 1717<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 1723<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 1858$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "0", "Simple1.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''.", 1859$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "1", "Simple2.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 2176$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'DLLCertificate'. The library is considered 3rd party library due to its copyright: ''.", 2177$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate3'. The library is considered 3rd party library due to its copyright: ''.", 2178$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "10", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate4'. The library is considered 3rd party library due to its copyright: ''.", 2179$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "16", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate5'. The library is considered 3rd party library due to its copyright: ''.", 2180$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "23", "Simple.dll")}' with Microsoft certificate 'DLLCertificate2'. The library is considered 3rd party library due to its copyright: ''." 2299var tempDir = Path.GetTempPath(); 2300string workingDir = Path.Combine(tempDir, "extract", Guid.NewGuid().ToString()); 2301string outputDir = Path.Combine(tempDir, "output", Guid.NewGuid().ToString()); 2302string createFileName = Path.Combine(workingDir, "create.cmd"); 2303string outputFileName = Path.Combine(outputDir, expectedExe); 2313File.Delete(Path.Combine(workingDir, "Bundle.wixobj"));
Microsoft.DotNet.SourceBuild.Tasks (11)
src\UsageReport\ValidateUsageAgainstBaseline.cs (2)
63Directory.CreateDirectory(Path.GetDirectoryName(OutputBaselineFile)); 66Directory.CreateDirectory(Path.GetDirectoryName(OutputReportFile));
src\UsageReport\WritePackageUsageData.cs (5)
150Directory.CreateDirectory(Path.GetDirectoryName(ProjectAssetsJsonArchiveFile)); 163using (var stream = File.OpenRead(Path.Combine(RootDir, relativePath))) 184using (var file = File.OpenRead(Path.Combine(RootDir, assetFile))) 254Directory.CreateDirectory(Path.GetDirectoryName(DataFile)); 268return path.Substring(RootDir.Length).Replace(Path.DirectorySeparatorChar, '/');
src\UsageReport\WriteUsageReports.cs (3)
102poisonNupkgFilenames.Add(Path.GetFileNameWithoutExtension(segments[1])); 162Path.Combine(OutputDirectory, "annotated-usage.xml"), 204string filename = Path.GetFileName(snapshot.Path);
src\WriteBuildOutputProps.cs (1)
75Directory.CreateDirectory(Path.GetDirectoryName(OutputPath));
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
107string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Languages\Language.cs (4)
19public static string BasePath { get; set; } = Path.GetDirectoryName(typeof(Templates).Assembly.Location); 23string templateDirectory = Path.GetFullPath(Path.Combine( 30var relative = Path.GetFullPath(file);
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
85string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.VersionTools (8)
Automation\LocalVersionsRepoUpdater.cs (4)
41string latestPackagesDir = Path.Combine( 54Path.Combine(latestPackagesDir, BuildInfo.LastBuildPackagesTxtFilename), 68Path.Combine(latestPackagesDir, BuildInfo.LatestTxtFilename), 72Path.Combine(latestPackagesDir, BuildInfo.LatestPackagesTxtFilename),
BuildInfo.cs (3)
105? Path.Combine(cacheDir, gitRef, buildInfoPath, "buildinfo.json") 141string latestPackagesPath = Path.Combine(dir, relativePath, LatestPackagesTxtFilename); 150string latestReleasePath = Path.Combine(dir, relativePath, LatestTxtFilename);
BuildManifest\Model\SigningInformationParsingExtensions.cs (1)
41if (!signInfo.Include.Equals(Path.GetExtension(signInfo.Include)))
Microsoft.DotNet.VersionTools.Cli (1)
VersionTrimmingOperation.cs (1)
45if (assets.Any(a => Path.GetExtension(a) != ".nupkg"))
Microsoft.DotNet.XliffTasks (48)
Model\Document.cs (3)
70string tempPath = Path.Combine(Path.GetDirectoryName(path), Path.GetRandomFileName());
Model\ResxDocument.cs (3)
65string resourceRelativePath = splitRelativePathAndSerializedType[0].Replace('\\', Path.DirectorySeparatorChar); 67string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Model\VsctDocument.cs (3)
85string resourceRelativePath = hrefAttribute.Value.Replace('\\', Path.DirectorySeparatorChar); 87string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Tasks\GatherTranslatedSource.cs (11)
52Path.DirectorySeparatorChar, 53Path.AltDirectorySeparatorChar 66string relativePath = Path.GetFileName(translatedFullPath); 69relativePath = Path.Combine(language, relativePath); 78string linkDirectory = Path.GetDirectoryName(link); 79link = Path.Combine(linkDirectory, relativePath); 100string logicalExtension = Path.GetExtension(logicalName); 101logicalName = Path.ChangeExtension(logicalName, $".{language}{logicalExtension}"); 111string sourceDirectory = Path.GetDirectoryName(xlf.GetMetadataOrThrow(MetadataKey.XlfSource)); 112dependentUpon = Path.GetFullPath(Path.Combine(sourceDirectory, dependentUpon));
Tasks\GatherXlf.cs (5)
58translatedFileName = Path.GetFileNameWithoutExtension(source.ItemSpec); 63string extension = Path.GetExtension(source.ItemSpec); 66Path.Combine(TranslatedOutputDirectory, language, $"{translatedFileName}{extension}") : 67Path.Combine(TranslatedOutputDirectory, $"{translatedFileName}.{language}{extension}"); 72$"Two or more source files to be translated in the same project are named {Path.GetFileName(sourceDocumentPath)}. " +
Tasks\SortXlf.cs (1)
45Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
Tasks\TransformTemplates.cs (14)
63string templateName = Path.GetFileNameWithoutExtension(template.ItemSpec); 65string templateDirectory = Path.GetDirectoryName(templatePath); 70? Path.Combine(TranslatedOutputDirectory, $"{templateName}.default.1033") 71: Path.Combine(TranslatedOutputDirectory, $"{templateName}.{language}"); 73string cultureSpecificTemplateFile = Path.Combine(localizedTemplateDirectory, Path.GetFileName(template.ItemSpec)); 79string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 80File.Copy(projectFileFullPath, Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value)), overwrite: true); 86string templateItemFullPath = Path.Combine(templateDirectory, templateItem.Value); 87string templateItemDestinationPath = Path.Combine(localizedTemplateDirectory, templateItem.Value); 104Path.GetFileNameWithoutExtension(unstructuredResource.ItemSpec), 107Path.GetExtension(unstructuredResource.ItemSpec)); 108File.Copy(Path.Combine(TranslatedOutputDirectory, localizedFileName), templateItemDestinationPath, overwrite: true);
Tasks\TranslateSource.cs (2)
39Directory.CreateDirectory(Path.GetDirectoryName(translatedFullPath)); 41sourceDocument.RewriteRelativePathsToAbsolute(Path.GetFullPath(sourcePath));
Tasks\UpdateXlf.cs (1)
71Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
Tasks\XlfTask.cs (5)
92string directory = Path.GetDirectoryName(sourcePath); 93string filename = Path.GetFileNameWithoutExtension(sourcePath); 94string extension = Path.GetExtension(sourcePath); 106return Path.Combine(directory, "xlf", filename + xlfExtension); 111return $"../{Path.GetFileName(sourcePath)}";
Microsoft.DotNet.XliffTasks.Tests (7)
ResxDocumentTests.cs (3)
55string expectedAbsoluteLocation = Path.Combine( 57@"Resources\Package.ico".Replace('\\', Path.DirectorySeparatorChar)); 76Path.Combine(sourceFolder, "Resources.resx"));
VsctDocumentTests.cs (4)
77string expectedAbsoluteLocation = Path.Combine( 79@"Resources\Images.png".Replace('\\', Path.DirectorySeparatorChar)); 99Path.Combine(sourceFolder, "Resources.resx")); 119Path.Combine(Directory.GetCurrentDirectory(), "Resources.resx"));
Microsoft.DotNet.XUnitAssert.Tests (3)
EquivalenceAssertsTests.cs (3)
1485 var assemblyPath = Path.GetDirectoryName(typeof(SpecialCases).Assembly.Location); 1497 var assemblyPath = Path.GetDirectoryName(typeof(SpecialCases).Assembly.Location); 1499 var assemblyParentPath = Path.GetDirectoryName(assemblyPath);
Microsoft.Extensions.ApiDescription.Client (3)
GetOpenApiReferenceMetadata.cs (3)
95if (!Path.IsPathRooted(outputPath) && !string.IsNullOrEmpty(OutputDirectory)) 97outputPath = Path.Combine(OutputDirectory, outputPath); 113var outputFilename = Path.GetFileNameWithoutExtension(outputPath);
Microsoft.Extensions.ApiDescription.Client.Tests (78)
GetOpenApiReferenceMetadataTest.cs (22)
18var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 20var outputPath = Path.Combine("obj", "NSwagClient.cs"); 70var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 73var outputPath = Path.Combine("obj", $"NSwagClient.cs"); 129var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 131var outputPath = Path.Combine("obj", "NSwagClient.cs"); 186var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 189var outputPath = Path.Combine(Path.GetTempPath(), $"{className}.cs"); 244var identity1 = Path.Combine("TestProjects", "files", "NSwag.json"); 245var identity2 = Path.Combine("TestProjects", "files", "swashbuckle.json"); 290var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 292var error = Resources.FormatDuplicateFileOutputPaths(Path.Combine("obj", "NSwagClient.cs")); 335var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 339var expectedOutputPath = Path.Combine("bin", outputPath); 400var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 402var expectedOutputPath = Path.Combine("bin", outputPath); 457var identity12 = Path.Combine("TestProjects", "files", "NSwag.json"); 458var identity3 = Path.Combine("TestProjects", "files", "swashbuckle.json"); 467var outputPath1 = Path.Combine("obj", $"{className12}.cs"); 468var outputPath2 = Path.Combine("obj", $"{className12}.ts"); 469var outputPath3 = Path.Combine("obj", $"{className3}.cs");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
TargetTest.cs (48)
19private static string _assemblyLocation = Path.GetDirectoryName(_assembly.Location); 38var directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "build")); 41file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true); 43directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "build")); 46file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true); 50directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "files")); 53file.CopyTo(Path.Combine(files.Root, file.Name), overwrite: true); 60file.CopyTo(Path.Combine(tasks.Root, file.Name), overwrite: true); 80Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 81Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 103Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output); 104Assert.Contains($"TypeScriptCompile: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output); 123Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 124Assert.Contains($"Compile: {Path.Combine("obj", "NSwagClient.cs")}", process.Output); 125Assert.Contains($"Compile: {Path.Combine("obj", "swashbuckleClient.cs")}", process.Output); 126Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 127Assert.Contains($"FileWrites: {Path.Combine("obj", "NSwagClient.cs")}", process.Output); 128Assert.Contains($"FileWrites: {Path.Combine("obj", "swashbuckleClient.cs")}", process.Output); 149Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", process.Output); 150Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", process.Output); 152$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", 155$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", 178$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 180$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 203$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 205$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 228$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 230$"Options: '' OutputPath: '{Path.Combine("generated", "azureMonitorClient.cs")}'", 255$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 257$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 280$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 282$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'", 305$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 307$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 330$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 332$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 357$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 359$"Options: '' OutputPath: '{Path.Combine("obj", "Custom.cs")}'", 381$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 383$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 387$"{Path.Combine(_temporaryDirectory.Root, "files", "NSwag.json")} " + 389$"Options: '' OutputPath: '{Path.Combine("obj", "NSwagClient.cs")}'", 393$"{Path.Combine(_temporaryDirectory.Root, "files", "swashbuckle.json")} " + 395$"Options: '' OutputPath: '{Path.Combine("obj", "swashbuckleClient.cs")}'", 422$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 424$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 428$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 430$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Infrastructure\RedisTestConfig.cs (4)
137return Path.Combine(configFilePath, UserProfileRedisNugetPackageServerPath, RedisServerExeName); 143return Path.Combine(configFilePath, CIMachineRedisNugetPackageServerPath, RedisServerExeName); 155var tempPath = Path.GetTempPath(); 157Path.Combine(tempPath, FunctionalTestsRedisServerExeName + ".exe");
Microsoft.Extensions.Configuration.FileExtensions (7)
FileConfigurationProvider.cs (1)
116/// Loads the contents of the file at <see cref="Path"/>.
FileConfigurationSource.cs (6)
73System.IO.Path.IsPathRooted(Path)) 75string? directory = System.IO.Path.GetDirectoryName(Path); 76string? pathToFile = System.IO.Path.GetFileName(Path); 79pathToFile = System.IO.Path.Combine(System.IO.Path.GetFileName(directory), pathToFile); 80directory = System.IO.Path.GetDirectoryName(directory);
Microsoft.Extensions.Configuration.UserSecrets (4)
PathHelper.cs (3)
49int badCharIndex = userSecretsId.IndexOfAny(Path.GetInvalidFileNameChars()); 80? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 81: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
UserSecretsConfigurationExtensions.cs (1)
182string? directoryPath = Path.GetDirectoryName(secretPath);
Microsoft.Extensions.DependencyModel (21)
ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
DependencyContextExtensions.cs (1)
112string name = Path.GetFileNameWithoutExtension(assetPath);
DependencyContextJsonReader.cs (2)
796groupRuntimeAssemblies.Where(a => Path.GetFileName(a.Path) != "_._"))); 808groupNativeLibraries.Where(a => Path.GetFileName(a.Path) != "_._")));
DependencyContextLoader.cs (2)
136string depsJsonFile = Path.ChangeExtension(assemblyLocation, DepsJsonExtension); 147depsJsonFile = Path.ChangeExtension(assemblyCodeBase, DepsJsonExtension);
Resolution\AppBaseCompilationAssemblyResolver.cs (4)
61string refsPath = Path.Combine(_basePath, RefsDirectoryName); 84string? sharedDirectory = Path.GetDirectoryName(sharedPath); 87string sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 100string assemblyFile = Path.GetFileName(assembly);
Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split(new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries); 74return new string[] { Path.Combine(basePath, ".nuget", "packages") };
Resolution\ReferenceAssemblyPathResolver.cs (5)
69string relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 77string name = Path.GetFileName(path); 81string fallbackFile = Path.Combine(fallbackPath, name); 105string net20Dir = Path.Combine(windir, "Microsoft.NET", "Framework", "v2.0.50727"); 146return Path.Combine(
Resolution\ResolverUtils.cs (3)
15path = Path.Combine(library.Name, library.Version); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.Combine(basePath, assemblyPath);
RuntimeAssembly.cs (1)
34string assemblyName = System.IO.Path.GetFileNameWithoutExtension(path);
Microsoft.Extensions.FileProviders.Embedded (9)
EmbeddedFileProvider.cs (4)
24private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 100var everettId = MakeValidEverettIdentifier(Path.GetDirectoryName(subpath)); 110builder.Append(Path.GetFileName(subpath)); 118var name = Path.GetFileName(subpath);
Manifest\EmbeddedFilesManifest.cs (5)
15private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 16.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 18private static readonly char[] _separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
ManifestEmbeddedFileProviderTests.cs (6)
65var jqueryValidate = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.validate.js")); 72var jqueryMin = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.min.js")); 79var siteCss = provider.GetFileInfo(Path.Combine("wwwroot", "site.css")); 164var jqueryValidate = provider.GetFileInfo(Path.Combine(folder, file)); 187var jqueryValidate = provider.GetFileInfo(Path.Combine(".", "wwwroot", "jquery.validate.js")); 210var jqueryValidate = provider.GetFileInfo(Path.Combine("..", "wwwroot", "jquery.validate.js"));
Microsoft.Extensions.FileProviders.Physical (22)
Internal\PathUtils.cs (7)
14private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 15.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 41{Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}; 46path[path.Length - 1] != Path.DirectorySeparatorChar) 48return path + Path.DirectorySeparatorChar;
PhysicalFileProvider.cs (9)
27{Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}; 56if (!Path.IsPathRooted(root)) 61string fullRoot = Path.GetFullPath(root); 162string root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root)); 238fullPath = Path.GetFullPath(Path.Combine(Root, path)); 274if (Path.IsPathRooted(subpath)) 316if (Path.IsPathRooted(subpath))
PhysicalFilesWatcher.cs (5)
141if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter)) 195var pollingChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath))); 298string oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1)); 448(path[path.Length - 1] == Path.DirectorySeparatorChar || 449path[path.Length - 1] == Path.AltDirectorySeparatorChar);
PollingWildCardChangeToken.cs (1)
148string filePath = Path.Combine(_directoryInfo.FullName, path);
Microsoft.Extensions.FileSystemGlobbing (27)
Abstractions\DirectoryInfoWrapper.cs (2)
77new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), 103=> new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name)));
InMemoryDirectoryInfo.cs (22)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 40Name = Path.GetFileName(rootDir); 49string normalizedRoot = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 54string fileWithNormalSeparators = file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 55if (Path.IsPathRooted(file)) 57fileList.Add(Path.GetFullPath(fileWithNormalSeparators)); 61fileList.Add(Path.GetFullPath(Path.Combine(normalizedRoot, fileWithNormalSeparators))); 79new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName)!, _files, true); 125(rootDir[rootDirLength - 1] == Path.DirectorySeparatorChar || 126filePath.IndexOf(Path.DirectorySeparatorChar, rootDirLength) == rootDirLength); 134return new InMemoryDirectoryInfo(Path.Combine(FullName, path), _files, true); 138string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 150string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Internal\InMemoryFileInfo.cs (1)
16Name = Path.GetFileName(file);
MatcherExtensions.cs (2)
64result.Add(Path.GetFullPath(Path.Combine(directoryPath, match.Path)));
Microsoft.Extensions.Hosting (3)
HostBuilder.cs (3)
255if (Path.IsPathRooted(contentRootPath)) 259return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizerFactory.cs (4)
48_resourcesRelativePath = _resourcesRelativePath.Replace(Path.AltDirectorySeparatorChar, '.') 49.Replace(Path.DirectorySeparatorChar, '.') + "."; 231.Replace(Path.DirectorySeparatorChar, '.') 232.Replace(Path.AltDirectorySeparatorChar, '.');
Microsoft.Extensions.Localization.Tests (5)
ResourceManagerStringLocalizerFactoryTest.cs (5)
67var resourceLocationAttribute = new ResourceLocationAttribute(Path.Combine("My", "Resources")); 136var resourcePath = Path.Combine("My", "Resources"); 164var resourcePath = Path.Combine("My", "Resources"); 189locOptions.ResourcesPath = Path.Combine("My", "Resources"); 269locOptions.ResourcesPath = Path.Combine("My", "Resources");
Microsoft.Extensions.Logging.AzureAppServices (4)
FileLoggerConfigureOptions.cs (1)
23options.LogDirectory = Path.Combine(_context.HomeFolder, "LogFiles", "Application");
FileLoggerProvider.cs (1)
66return Path.Combine(_path, $"{_fileName}{group.Year:0000}{group.Month:00}{group.Day:00}.txt");
SiteConfigurationProvider.cs (2)
13var settingsFolder = Path.Combine(context.HomeFolder, "site", "diagnostics"); 14var settingsFile = Path.Combine(settingsFolder, "settings.json");
Microsoft.Extensions.SecretManager.Tools.Tests (34)
InitCommandTest.cs (3)
92var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 104var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 134string secretId = $"invalid{Path.GetInvalidPathChars()[0]}secret-id";
MsBuildProjectFinderTest.cs (1)
25Assert.Equal(Path.Combine(files.Root, filename), finder.FindMsBuildProject(null));
SecretManagerTests.cs (15)
43var project = Path.Combine(_fixture.CreateProject(id), "TestProject.csproj"); 53var project = Path.Combine(_fixture.CreateProject("<"), "TestProject.csproj"); 63var projectPath = Path.Combine(_fixture.GetTempSecretProject(), "does_not_exist", "TestProject.csproj"); 74var cwd = Path.Combine(projectPath, "nested1"); 78secretManager.RunInternal("list", "-p", ".." + Path.DirectorySeparatorChar, "--verbose"); 80Assert.Contains(Resources.FormatMessage_Project_File_Path(Path.Combine(cwd, "..", "TestProject.csproj")), _console.GetOutput()); 101: Path.GetTempPath(); 175Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 182Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 218Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 231Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 233var secretManager = new Program(_console, Path.GetDirectoryName(projectPath)); 247Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 279: Path.GetTempPath(); 333var project = Path.Combine(projectPath, "TestProject.csproj");
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
TemporaryFileProvider.cs (3)
14Root = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "tmpfiles", Guid.NewGuid().ToString())).FullName; 21File.WriteAllText(Path.Combine(Root, filename), contents, Encoding.UTF8);
UserSecretsTestFixture.cs (5)
19_disposables.Push(() => TryDelete(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId)))); 57var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "usersecretstest", Guid.NewGuid().ToString())); 63Path.Combine(projectPath.FullName, "TestProject.csproj"), 72var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(id));
Microsoft.NET.Sdk.WebAssembly.Pack.Tasks (43)
BootJsonBuilderHelper.cs (1)
56string resourceExtension = Path.GetExtension(resourceName);
ComputeWasmBuildAssets.cs (13)
114assetCandidate.SetMetadata("RelatedAsset", Path.GetFullPath(Path.Combine(OutputPath, "wwwroot", "_framework", Path.GetFileName(assetCandidate.GetMetadata("ResolvedFrom"))))); 130var originalFileFullPath = Path.GetFullPath(candidate.ItemSpec); 131var originalFileDirectory = Path.GetDirectoryName(originalFileFullPath); 133newDotNetJSFullPath = Path.Combine(originalFileDirectory, newDotnetJSFileName); 138newDotnetJSFileName = Path.GetFileName(newDotNetJSFullPath); 176var relatedAssetPath = Path.GetFullPath(Path.Combine( 211var assetCandidate = new TaskItem(Path.GetFullPath(projectSatelliteAssembly.ItemSpec), projectSatelliteAssembly.CloneCustomMetadata()); 212var projectAssemblyAssetPath = Path.GetFullPath(Path.Combine( 224assetCandidate.SetMetadata("RelativePath", Path.Combine("_framework", normalizedPath));
ComputeWasmPublishAssets.cs (15)
179if (resolvedNativeAssetToPublish.TryGetValue(Path.GetFileName(asset.GetMetadata("OriginalItemSpec")), out var existing)) 208var baseName = Path.GetFileNameWithoutExtension(key); 222newDotNetJs = new TaskItem(Path.GetFullPath(aotDotNetJs.ItemSpec), asset.CloneCustomMetadata()); 259newDotNetWasm = new TaskItem(Path.GetFullPath(aotDotNetWasm.ItemSpec), asset.CloneCustomMetadata()); 295var fileName = Path.GetFileName(key); 301var name = Path.GetFileName(key); 321if (resolvedSymbolAssetToPublish.TryGetValue(Path.GetFileName(asset.GetMetadata("OriginalItemSpec")), out var existing)) 378var fileName = Path.GetFileName(asset.GetMetadata("RelativePath")); 380fileName = Path.ChangeExtension(fileName, ".dll"); 402var fileName = Path.GetFileName(satelliteAssembly.GetMetadata("RelativePath")); 404fileName = Path.ChangeExtension(fileName, ".dll"); 538newAsemblyAsset.SetMetadata("ContentRoot", Path.Combine(PublishPath, "wwwroot")); 626var assemblyName = Path.GetFileName(candidate.GetMetadata("RelativePath").Replace("\\", "/")); 638var candidateName = Path.GetFileName(candidate.GetMetadata("RelativePath")); 653var candidateName = Path.GetFileName(candidate.GetMetadata("RelativePath"));
ConvertDllsToWebCil.cs (6)
82var webcilFileName = Path.GetFileNameWithoutExtension(dllFilePath) + Utils.WebcilInWasmExtension; 84? Path.Combine(OutputPath, candidate.GetMetadata("AssetTraitValue")) 87string finalWebcil = Path.Combine(candidatePath, webcilFileName); 91var tmpWebcil = Path.Combine(tmpDir, webcilFileName); 112webcilItem.SetMetadata("RelativePath", Path.ChangeExtension(candidate.GetMetadata("RelativePath"), Utils.WebcilInWasmExtension)); 118relatedAsset = Path.ChangeExtension(relatedAsset, Utils.WebcilInWasmExtension);
GenerateWasmBootJson.cs (2)
175var resourceName = Path.GetFileName(resource.GetMetadata("RelativePath")); 351string configUrl = Path.GetFileName(configFile.ItemSpec);
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
Microsoft.VisualBasic.Core (78)
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (10)
26If PathName.Length > 0 AndAlso PathName.Chars(PathName.Length - 1) = Path.DirectorySeparatorChar Then 27DirName = Path.GetFullPath(PathName) 33FileName = Path.GetFileName(PathName) 34DirName = Path.GetDirectoryName(PathName) 42If Path.IsPathRooted(PathName) Then 43DirName = Path.GetPathRoot(PathName) 46If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 47DirName = DirName & Path.DirectorySeparatorChar 51If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 52DirName = DirName & Path.DirectorySeparatorChar
Microsoft\VisualBasic\FileIO\FileSystem.vb (60)
71baseDirectory = IO.Path.GetFullPath(baseDirectory) ' Throw exceptions if BaseDirectoryPath is invalid. 73Return NormalizePath(IO.Path.Combine(baseDirectory, relativePath)) 92(file.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) Or 93file.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) Then 223Return IO.Path.GetFileName(path) 234''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath: If path is an invalid path.</exception> 241IO.Path.GetFullPath(path) 246Return IO.Path.GetDirectoryName(path.TrimEnd( 247IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)) 476directory = IO.Path.GetFullPath(directory) 545''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath() exceptions: if FilePath is invalid.</exception> 656''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If directory is invalid.</exception> 663directory = IO.Path.GetFullPath(directory) 699''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If file is invalid.</exception> 837''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath for possible exceptions.</exception> 840Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) 852If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or 853path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then 883''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If SourceDirectoryPath or TargetDirectoryPath is invalid. 938If TargetDirectoryFullPath.Chars(SourceDirectoryFullPath.Length) = IO.Path.DirectorySeparatorChar Then 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 1041CopyOrMoveFile(Operation, SubFilePath, IO.Path.Combine(SourceDirectoryNode.TargetPath, IO.Path.GetFileName(SubFilePath)), 1083''' <exception cref="IO.Path.GetFullPath"> 1186Dim directoryFullPath As String = IO.Path.GetFullPath(directory) 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1464Dim FullPath As String = RemoveEndingSeparator(IO.Path.GetFullPath(IO.Path.Combine(Path, NewName))) 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1498Return DInfo.GetFiles(IO.Path.GetFileName(FullPath))(0).FullName 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1502Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName 1538Path1 = Path1.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1539Path2 = Path2.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1540Return String.Equals(IO.Path.GetPathRoot(Path1), IO.Path.GetPathRoot(Path2), StringComparison.OrdinalIgnoreCase) 1556If Not IO.Path.IsPathRooted(Path) Then 1560Path = Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1561Return String.Equals(Path, IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) 1571If IO.Path.IsPathRooted(Path) Then 1576If Path.Equals(IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) Then 1582Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 2056IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar, IO.Path.VolumeSeparatorChar} 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2103Dim SubTargetDirPath As String = IO.Path.Combine(m_TargetPath, IO.Path.GetFileName(SubDirPath))
Microsoft\VisualBasic\FileIO\SpecialDirectories.vb (1)
100Return GetDirectoryPath(IO.Path.GetTempPath(), SR.IO_SpecialDirectory_Temp)
Microsoft\VisualBasic\FileSystem.vb (7)
90IO.Directory.SetCurrentDirectory(Drive & Path.VolumeSeparatorChar) 123Dim CurrentPath As String = Path.GetFullPath(Drive & Path.VolumeSeparatorChar & ".") 366If Path.GetFileName(PathName).Length = 0 Then 386DirName = Path.GetDirectoryName(PathName) 392FileName = Path.GetFileName(PathName) 397DirName = DirName & Path.PathSeparator
Microsoft.Web.Xdt.Extensions.Tests (4)
InsertOrAppendAttributeTests.cs (4)
16var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 40var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 64var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 88var transform = new XmlTransformation(Path.GetFullPath("transform.xdt"));
MobileBuildTasks (33)
Android\AndroidProject.cs (4)
36androidToolchainPath = Path.Combine(androidNdkPath, "build", "cmake", "android.toolchain.cmake"); 91return Path.Combine(workingDir, projectName); 123string rootPath = Path.GetDirectoryName(lib)!; 124string libName = Path.GetFileName(lib);
Android\Ndk\Ndk.cs (8)
72Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Android", "android-sdk", "ndk-bundle"), 73Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86), "Android", "android-sdk-windows", "ndk-bundle"), 75? Path.Combine(Environment.GetEnvironmentVariable("ProgramW6432") ?? "", "Android", "android-sdk", "ndk-bundle") 76: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Android", "android-sdk", "ndk-bundle"), 77Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Android", "android-sdk", "ndk-bundle"), 78Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Android", "android-sdk", "ndk-bundle"), 84Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Android", "sdk") 99string sourcePropertiesPath = Path.Combine(NdkPath, "source.properties");
Android\Ndk\NdkTools.cs (5)
53toolRootPath = Path.Combine(Ndk.NdkPath, "toolchains", "llvm", "prebuilt", this.hostOS); 55asPrefixPath = Path.Combine(toolRootPath, Triple, "bin"); 56toolPrefixPath = Path.Combine(toolRootPath, "bin"); 61clangPath = Path.Combine(ToolPrefixPath, $"{armClangPrefix}{apiLevel}-clang{cmdExt}"); 65clangPath = Path.Combine(ToolPrefixPath, $"{Triple}{apiLevel}-clang{cmdExt}");
Apple\AppleProject.cs (6)
68string frameworkPath = Path.Combine(SdkRoot, "System", "iOSSupport", "System", "Library", "Frameworks"); 69string iosLibPath = Path.Combine(SdkRoot, "System", "iOSSupport", "usr", "lib"); 103string ext = Path.GetExtension(source); 120string rootPath = Path.GetDirectoryName(lib)!; 121string libName = Path.GetFileName(lib); 122string ext = Path.GetExtension(lib);
Apple\AppleSdk.cs (4)
28sdkDir = Path.Combine(devRoot, "Contents", "Developer", "Platforms", $"{platformName}.platform", "Developer", "SDKs"); 55if (!File.Exists(Path.Combine(dir, "SDKSettings.plist"))) 60string d = Path.GetFileName(dir); 82sdkRoot = Path.Combine(sdkDir, $"{platformName}{version}.sdk");
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
MonoAOTCompiler (44)
MonoAOTCompiler.cs (37)
328if (string.IsNullOrEmpty(WorkingDirectory) && !Path.IsPathRooted(OutputDir)) 329OutputDir = Path.GetFullPath(OutputDir); 495string propertiesTableFilePath = Path.Combine(IntermediateOutputPath, "monoAotPropertyValues.txt"); 507monoPaths = string.Join(Path.PathSeparator.ToString(), AdditionalAssemblySearchPaths); 628string firstAsmDir = Path.GetDirectoryName(assemblies.First().GetMetadata("FullPath")) ?? string.Empty; 629bool allInSameDir = assemblies.All(asm => Path.GetDirectoryName(asm.GetMetadata("FullPath")) == firstAsmDir); 635string aotInPath = Path.Combine(IntermediateOutputPath, "aot-in"); 642string newPath = Path.Combine(aotInPath, Path.GetFileName(asmPath)); 662string assemblyDir = Path.GetDirectoryName(assembly)!; 666bool isDedup = Path.GetFileName(assembly) == Path.GetFileName(DedupAssembly); 742string assemblyFilename = Path.GetFileName(assembly); 764outputFilePath = Path.Combine(TrimmingEligibleMethodsOutputDirectory, outputFileName); 775string llvmBitcodeFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".dll.bc")); 816string objectFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".dll.o")); 828string assemblerFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".dll.s")); 845string libraryFilePath = Path.Combine(OutputDir, libraryFileName); 860string llvmObjectFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".dll-llvm.o")); 878string aotTmpPath = Path.Combine(IntermediateOutputPath, assemblyFilename + ".tmp"); 888string exportSymbolsFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".exportsymbols")); 904string aotDataFile = Path.ChangeExtension(assembly, ".aotdata"); 976monoPaths = $"{assemblyDir}{Path.PathSeparator}{monoPaths}"; 984var responseFilePath = Path.GetTempFileName(); 1003string msgPrefix = $"[{Path.GetFileName(assembly)}] "; 1013label: Path.GetFileName(assembly)); 1052string copiedFiles = string.Join(", ", args.ProxyFiles.Select(tf => Path.GetFileName(tf.TargetFile))); 1054Log.LogMessage(MessageImportance.High, $"[{count}/{_totalNumAssemblies}] {Path.GetFileName(assembly)} -> {copiedFiles}"); 1102Directory.CreateDirectory(Path.GetDirectoryName(outputFile)!); 1211string assemblyFilename = Path.GetFileName(assembly); 1212string exportSymbolsFile = Path.Combine(OutputDir, Path.ChangeExtension(assemblyFilename, ".exportsymbols"));
src\tasks\Common\TempFileName.cs (1)
10public TempFileName() => Path = System.IO.Path.GetTempFileName();
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
MonoTargetsTasks (21)
EmitBundleTask\EmitBundleBase.cs (5)
118registeredName = !string.IsNullOrEmpty(culture) ? culture + "/" + Path.GetFileName(resourcePath) : Path.GetFileName(resourcePath); 129string destinationFile = Path.Combine(OutputDirectory, resourceDataSymbol + GetDestinationFileExtension()); 224string bundleFilePath = Path.Combine(OutputDirectory, BundleFile); 453filename = Path.GetFileName(destinationFileName);
EmitBundleTask\EmitBundleObjectFiles.cs (2)
27if (Path.GetDirectoryName(destinationFile) is string destDir && !string.IsNullOrEmpty(destDir)) 34debugMessageImportance: MessageImportance.Low, label: Path.GetFileName(destinationFile),
ILStrip\ILStrip.cs (3)
68trimmedAssemblyFolder = string.IsNullOrEmpty(IntermediateOutputPath) ? "stripped" : Path.Combine(IntermediateOutputPath, "stripped"); 215string? assemblyName = Path.GetFileName(assemblyFilePath); 216return Path.Combine(trimmedAssemblyFolder, assemblyName);
NetTraceToMibcConverterTask\NetTraceToMibcConverter.cs (4)
70string mibcConverterBinaryPath = Path.Combine(ToolPath, ToolExe); 102MibcFilePath = Path.Combine(OutputDir, Path.ChangeExtension(Path.GetFileName(NetTraceFilePath), ".mibc"));
RuntimeConfigParser\RuntimeConfigParser.cs (1)
73Directory.CreateDirectory(Path.GetDirectoryName(OutputFile!)!);
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
MSBuild (109)
AssemblyLoadInfo.cs (1)
179ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
839String.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), Process.GetCurrentProcess().Id, nodeId), append: true))
DebugUtils.cs (6)
43debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 109var extension = Path.GetExtension(fileName); 110var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 112var fullPath = Path.Combine(DebugPath, fileName); 118fullPath = Path.Combine(DebugPath, fileName);
ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (38)
74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 477return NormalizePath(Path.Combine(paths)); 496Path.HasExtension(uncheckedFullPath); 500return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 683return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Modifiers.cs (9)
413modifiedItemSpec = Path.GetPathRoot(fullPath); 422modifiedItemSpec += Path.DirectorySeparatorChar; 437modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 451modifiedItemSpec = Path.GetExtension(itemSpec); 566modifiedItemSpec = Path.Combine( 617if (!Path.IsPathRooted(path)) 650return Path.GetDirectoryName(path) == null; 663fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
OutOfProcTaskHostNode.cs (1)
814? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), Process.GetCurrentProcess().Id))
PerformanceLogEventListener.cs (1)
85string logFilePath = Path.Combine(logDirectory, $"perf-{_processIDStr}-{Guid.NewGuid().ToString("N")}.log");
PrintLineDebugger.cs (1)
150return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
ProjectSchemaValidationHandler.cs (2)
46schemaFile = Path.Combine(binPath, "Microsoft.Build.xsd"); 98projectFile = Path.GetFullPath(projectFile);
TempFileUtilities.cs (7)
46string basePath = Path.Combine(Path.GetTempPath(), msbuildTempFolder); 85string temporaryDirectory = Path.Combine(TempFileDirectory, "Temporary" + Guid.NewGuid().ToString("N"), subfolder ?? string.Empty); 186string file = Path.Combine(directory, $"{fileName}{extension}"); 210string destFile = Path.Combine(dest, fileInfo.Name); 215string destDir = Path.Combine(dest, subdirInfo.Name); 232: System.IO.Path.Combine(TempFileDirectory, name);
TypeLoader.cs (5)
54string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 55microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 192string[] localAssemblies = Directory.GetFiles(Path.GetDirectoryName(path), "*.dll"); 198assembliesDictionary.Add(Path.GetFileName(localPath), localPath); 203assembliesDictionary[Path.GetFileName(runtimeAssembly)] = runtimeAssembly;
WindowsFileSystem.cs (3)
120var searchDirectoryPath = Path.Combine(directoryPath, "*"); 157result.Add(Path.Combine(directoryPath, findResult.CFileName)); 165Path.Combine(directoryPath, findResult.CFileName),
XMake.cs (19)
147s_exePath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 2183responseFile = Path.GetFullPath(responseFile); 2200var responseFileDirectory = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(responseFile)); 2400string autoResponseFile = Path.Combine(path, autoResponseFileName); 2741Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}"); 3001projectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFile)); 3508if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase)) 3523if (!extensionsToIgnore.Contains(Path.GetExtension(s))) 3541string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 3542string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 3561string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 3562string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 3614InitializationException.VerifyThrow(extension.IndexOfAny(Path.GetInvalidPathChars()) == -1, "InvalidExtensionToIgnore", extension, null, false); 3617InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false); 4061if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName)) 4064$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}"); 4081fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}"; 4474schemaFile = Path.Combine(Directory.GetCurrentDirectory(), fileName);
MSBuildTaskHost (64)
AssemblyLoadInfo.cs (1)
179ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BuildEnvironmentHelper.cs (9)
202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 336.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 359string directory = Path.GetDirectoryName(msBuildAssembly); 416var processFileName = Path.GetFileNameWithoutExtension(processName); 612MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 623? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 681defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
839String.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), Process.GetCurrentProcess().Id, nodeId), append: true))
Constants.cs (2)
129internal static readonly char[] DirectorySeparatorChar = { Path.DirectorySeparatorChar }; 133internal static readonly char[] PathSeparatorChar = { Path.PathSeparator };
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (1)
175if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
355s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (37)
49internal static string TempFileDirectory => Path.GetTempPath(); 74string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N")); 118internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 131cacheDirectory = Path.Combine(TempFileDirectory, String.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id)); 182string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid().ToString("N")}_testFile.txt"); 224fileSpec += Path.DirectorySeparatorChar; 261path.Substring(start) + Path.DirectorySeparatorChar); 349return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 379while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 471return NormalizePath(Path.Combine(directory, file)); 496Path.HasExtension(uncheckedFullPath); 500return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 503return Path.GetFullPath(path); 545return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 695string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 707directory += Path.DirectorySeparatorChar; 725if (Path.HasExtension(fileName)) 747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 762string fullPath = EscapingUtilities.Escape(NormalizePath(Path.Combine(currentDirectory, fileSpec))); 770fullPath += Path.DirectorySeparatorChar; 834var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1131string fullBase = Path.GetFullPath(basePath); 1132string fullPath = Path.GetFullPath(path); 1141while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1172sb.Append("..").Append(Path.DirectorySeparatorChar); 1176sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1179if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1223return Path.IsPathRooted(FixFilePath(path)); 1269return paths.Aggregate(root, Path.Combine); 1297var separator = Path.DirectorySeparatorChar; 1441string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1455lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1475if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Modifiers.cs (9)
413modifiedItemSpec = Path.GetPathRoot(fullPath); 422modifiedItemSpec += Path.DirectorySeparatorChar; 437modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 451modifiedItemSpec = Path.GetExtension(itemSpec); 566modifiedItemSpec = Path.Combine( 617if (!Path.IsPathRooted(path)) 650return Path.GetDirectoryName(path) == null; 663fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
NativeMethods.cs (2)
763Path.GetDirectoryName(baseTypeLocation) 783dir = Path.GetDirectoryName(dir);
OutOfProcTaskHostNode.cs (1)
814? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), Process.GetCurrentProcess().Id))
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
338[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Mvc.Api.Analyzers.Test (3)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (2)
37if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Infrastructure\MvcTestSource.cs (1)
15var filePath = Path.Combine(ProjectDirectory, "TestFiles", testClassName, testMethod + ".cs");
netstandard (1)
netstandard.cs (1)
948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NonDISample (1)
Program.cs (1)
13var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
PresentationBuildTasks (71)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (6)
149string currentProjectName = Path.GetFileNameWithoutExtension(CurrentProject); 150string currentProjectExtension = Path.GetExtension(CurrentProject); 159string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); 287( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ), 323foreach (FileInfo temporaryProjectFile in intermediateOutputPath.EnumerateFiles($"{Path.GetFileNameWithoutExtension(TemporaryTargetAssemblyProjectName)}*"))
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (10)
77_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 280if (!_outputDir.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 282_outputDir += Path.DirectorySeparatorChar; 728string buildCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, buildExtension); 729string intelCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, intellisenseExtension); 737bamlFile = OutputPath + Path.ChangeExtension(relativeFilePath, SharedStrings.BamlExtension); 877return Path.Combine(OutputPath, fileName); 1093int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1141asmname = Path.GetFileNameWithoutExtension(refpath); 1684locFile = Path.ChangeExtension(xamlRelativeFilePath, SharedStrings.LocExtension);
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (6)
60_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 256if (!_outputPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 258_outputPath += Path.DirectorySeparatorChar; 553int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 618asmname = Path.GetFileNameWithoutExtension(refpath); 787string bamlFileName = Path.ChangeExtension(resolvedXamlfile, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
62string absoluteFilePath = Path.Combine(
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (10)
49_sourcePath = Path.GetFullPath(path); 138SourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 266_outputPath = Path.GetFullPath(value); 268if (!_outputPath.EndsWith((Path.DirectorySeparatorChar).ToString(), StringComparison.Ordinal)) 269_outputPath += Path.DirectorySeparatorChar; 371string fullFilePath = Path.GetFullPath(filePath); 390relPath = Path.GetFileName(fullFilePath); 407Path.GetExtension(sourceFilePath).Equals(SharedStrings.BamlExtension) && 408Path.GetExtension(path).Equals(SharedStrings.XamlExtension)) 411path = Path.ChangeExtension(path, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\UidManager.cs (7)
166string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 369return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidtemp")); 374return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidbackup"));
MS\Internal\MarkupCompiler\MarkupCompiler.cs (12)
479if (!TargetPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 481TargetPath += Path.DirectorySeparatorChar; 485int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1600string pathOfRelativeSourceFilePath = System.IO.Path.GetDirectoryName(SourceFileInfo.RelativeSourceFilePath); 1607string path = Path.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath); 1610return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar; 1619string[] dirs = relPath.Split(Path.DirectorySeparatorChar); 2638Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, 3296string fullFilePath = Path.GetFullPath(_splashImage); 3309relPath = TaskHelper.GetRootRelativePath(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, fullFilePath); 3318resourceId = Path.GetFileName(fullFilePath);
MS\Internal\MarkupCompiler\PathInternal.cs (6)
64relativeTo = Path.GetFullPath(relativeTo); 65path = Path.GetFullPath(path); 111sb.Append(Path.DirectorySeparatorChar); 132sb.Append(Path.DirectorySeparatorChar); 147return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
MS\Internal\Tasks\CompilerWrapper.cs (4)
43_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 395if (!Path.IsPathRooted(filePath)) 401string fullFilePath = Path.GetFullPath(filePath); 424int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar);
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (5)
213string filepath = Path.GetFullPath(fileName); 468Path.GetFullPath(taskItem.ItemSpec), 491string curDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 499string fullPath = Path.GetFullPath(_mcPass1.ContentFiles[i].ItemSpec); 505relContentFilePath = Path.GetFileName(fullPath);
MS\Internal\Tasks\TaskHelper.cs (3)
76if (!Path.IsPathRooted(thePath) ) 82thePath = Path.GetFullPath(thePath); 102string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
569_cachedMetadataLoadContextAssembliesByNameNoExtension.Add(Path.GetFileNameWithoutExtension(fullPathToAssembly), assembly);
PresentationCore (25)
MS\Internal\FontCache\DWriteFactory.cs (3)
69localPath = Directory.GetParent(fontCollectionUri.LocalPath).FullName + Path.DirectorySeparatorChar; 77if (string.Equals((localPath.Length > 0 && localPath[localPath.Length - 1] != Path.DirectorySeparatorChar) ? localPath + Path.DirectorySeparatorChar : localPath, Util.WindowsFontsUriObject.LocalPath, StringComparison.OrdinalIgnoreCase))
MS\Internal\FontCache\FamilyCollection.cs (2)
60internal static string SxSFontsResourcePrefix { get; } = $"/{Path.GetFileNameWithoutExtension(ExternDll.PresentationCore)};component/fonts/"; 253FontSource fontSource = new FontSource(new Uri(Path.Combine(FamilyCollection.SxSFontsResourcePrefix, _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension), UriKind.RelativeOrAbsolute),
MS\Internal\FontCache\FontCacheUtil.cs (2)
311private static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars(); 608return Path.GetExtension(unescapedPath);
MS\Internal\FontCache\FontResourceCache.cs (1)
130string extension = Path.GetExtension(fileName);
MS\Internal\FontCache\FontSourceCollection.cs (6)
110_isFileSystemFolder = localPath[localPath.Length - 1] == Path.DirectorySeparatorChar; 154if (Path.GetFileName(fileName) == fileName) 155fileName = Path.Combine(Util.WindowsFontsLocalPath, fileName); 198if (Util.IsSupportedFontExtension(Path.GetExtension(file), out isComposite)) 222isComposite = Util.IsCompositeFont(Path.GetExtension(_uri.AbsoluteUri)); 227isComposite = Util.IsCompositeFont(Path.GetExtension(resourceName));
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
213String guid = Path.GetFileNameWithoutExtension(
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
141string extensionWithDot = Path.GetExtension(docString);
src\Microsoft.DotNet.Wpf\src\Shared\System\IO\FileHelper.cs (5)
102string folderPath = Path.GetTempPath(); 106string subFolderPath = Path.Combine(folderPath, subFolder); 120string path = Path.Combine(folderPath, Path.GetRandomFileName()); 123path = Path.ChangeExtension(path, extension);
System\Windows\clipboard.cs (1)
299string filePath = Path.GetFullPath(fileDrop);
System\Windows\dataobject.cs (1)
496string filePath = Path.GetFullPath(fileDrop);
System\Windows\Input\Cursor.cs (1)
229string filePath = Path.GetTempFileName();
System\Windows\Media\ColorContext.cs (1)
590profilePath = new Uri(Path.Combine(buffer.ToString(), profilePathString));
PresentationFramework (21)
Microsoft\Win32\FileDialog.cs (5)
116string safeFN = Path.GetFileName(CriticalItemName); 147safeFileNames[i] = Path.GetFileName(unsafeFileNames[i]); 479string tempPath = Path.GetFullPath(fileName); 601if (AddExtension && !Path.HasExtension(fileName)) 610string currentExtension = Path.GetExtension(fileName);
Microsoft\Win32\OpenFolderDialog.cs (2)
106string safeFN = Path.GetFileName(CriticalItemName); 137safeFolderNames[i] = Path.GetFileName(unsafeFolderNames[i]);
MS\Internal\AppModel\AppSecurityManager.cs (1)
215System.IO.Path.GetExtension(destinationUri.LocalPath)
MS\Internal\AppModel\ContentFilePart.cs (2)
76_fullPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), filePath);
MS\Internal\AppModel\ResourcePart.cs (3)
135if (String.Compare(Path.GetExtension(_name), ResourceContainer.BamlExt, StringComparison.OrdinalIgnoreCase) == 0) 140if (String.Compare(Path.GetExtension(_name), ResourceContainer.XamlExt, StringComparison.OrdinalIgnoreCase) == 0) 143string newName = Path.ChangeExtension(_name, ResourceContainer.BamlExt);
MS\Internal\IO\Packaging\PackageFilter.cs (1)
603string extension = Path.GetExtension(path);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (2)
114static readonly string _currentModuleDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 138_moduleHandle = Platform.LoadLibraryExW(System.IO.Path.Combine(_currentModuleDirectory, fileName), IntPtr.Zero, /* LOAD_WITH_ALTERED_SEARCH_PATH */ 8);
MS\Win32\UxThemeWrapper.cs (1)
271themeName = Path.GetFileNameWithoutExtension(themeName);
System\Windows\Documents\Speller.cs (1)
1593tempFolder = System.IO.Path.GetTempPath();
System\Windows\Shell\JumpList.cs (2)
139itemPath = Path.GetFullPath(itemPath); 1006return ShellUtil.GetShellItemForPath(Path.GetFullPath(jumpPath.Path));
System\Windows\SystemParameters.cs (1)
5552_uxThemeName = System.IO.Path.GetFileNameWithoutExtension(name);
PresentationUI (11)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
105_filename = Path.GetFileName(_uri.Value.LocalPath);
MS\Internal\Documents\Application\DocumentStream.cs (4)
824file = Path.GetFileNameWithoutExtension(path); 835Path.GetDirectoryName(path), 836Path.DirectorySeparatorChar, 972if (!Path.GetExtension(location.LocalPath).Equals(
MS\Internal\Documents\Application\FilePresentation.cs (1)
88Path.GetExtension(filePath),
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
382Path.GetFileNameWithoutExtension(DocumentProperties.Current.Filename),
MS\Internal\Documents\RightsManagementManager.cs (1)
879string msdrmdllPath = Path.Combine(systemPath, msdrmDLLName);
MS\Internal\Documents\RightsManagementProvider.cs (2)
1374string applicationManifestFileLocation = Path.Combine( Path.GetDirectoryName(fileName),
MS\Internal\Documents\RMPublishingDialog.cs (1)
1016return Path.GetFileNameWithoutExtension(_template.LocalPath);
ReachFramework (4)
Packaging\XpsFixedPageReaderWriter.cs (3)
1862ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1); 1907String extension = Path.GetExtension(path); 1908String fileName = Path.GetFileNameWithoutExtension(path);
Serialization\XpsFontSubsetter.cs (1)
667string fileName = System.IO.Path.GetFileNameWithoutExtension(
ResultsOfTGenerator (2)
Program.cs (2)
17var classTargetFilePath = Path.Combine(pwd, "ResultsOfT.Generated.cs"); 18var testsTargetFilePath = Path.Combine(pwd, "..", "test", "ResultsOfTTests.Generated.cs");
ServerComparison.FunctionalTests (4)
Helpers.cs (4)
19var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "FunctionalTests.slnf")); 22return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "..", "..", "testassets", "ServerComparison.TestSites")); 35var content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
SignalR.Client.FunctionalTestApp (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Sockets.BindTests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Sockets.FunctionalTests (5)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
38var path = Path.GetTempFileName(); 136var path = Path.GetTempFileName();
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
StaticFilesAuth (8)
Startup.cs (8)
30var basePath = Path.Combine(HostingEnvironment.ContentRootPath, "PrivateFiles"); 31var usersPath = Path.Combine(basePath, "Users"); 47var userPath = Path.Combine(usersPath, userName); 55|| directory.FullName.StartsWith(userPath + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase); 86var files = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "PrivateFiles")); 128new DirectoryInfo(Path.GetDirectoryName(fileSystemPath)), 146return Path.Join(files.Root, path); 154return Path.Join(files.Root, path);
Swaggatherer (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
50return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
90var path = Path.Combine(location, probingPath);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
17using IOPath = System.IO.Path; 741var fullPath = IOPath.GetFullPath(path);
System.ComponentModel.TypeConverter (3)
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
98string fileName = Path.GetFileName(location);
System\ComponentModel\LicFileLicenseProvider.cs (1)
81string? moduleDir = Path.GetDirectoryName(modulePath);
System\ComponentModel\SyntaxCheck.cs (1)
60return Path.IsPathRooted(value);
System.Console (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
28return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 41s_userProductDirectory = Path.Combine(
System.Data.Common (3)
System\Data\xmlsaver.cs (3)
1092_filePath = Path.GetDirectoryName(fs.Name); 1093_fileName = Path.GetFileNameWithoutExtension(fs.Name); 1094_fileExt = Path.GetExtension(fs.Name);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (2)
269if (!Path.IsPathFullyQualified(fileName)) 271fileName = Path.GetFullPath(fileName);
System.Diagnostics.Process (12)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
140currentCGroupMemoryPath = Path.GetDirectoryName(currentCGroupMemoryPath);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
64module = new ProcessModule(parsedLine.Path, Path.GetFileName(parsedLine.Path))
System\Diagnostics\Process.Unix.cs (8)
629if (Path.IsPathRooted(filename)) 649workingDirectory = workingDirectory != null ? Path.GetFullPath(workingDirectory) : 651string filenameInWorkingDirectory = Path.Combine(workingDirectory, filename); 693if (Path.IsPathRooted(filename)) 706path = Path.Combine(Path.GetDirectoryName(path)!, filename); 716path = Path.Combine(Directory.GetCurrentDirectory(), filename); 741path = Path.Combine(subPath, program);
System\Diagnostics\ProcessManager.Linux.cs (2)
114string dirName = Path.GetFileName(taskDir); 154string dirName = Path.GetFileName(procDir);
System.Diagnostics.TextWriterTraceListener (4)
System\Diagnostics\TextWriterTraceListener.cs (4)
227string fullPath = Path.GetFullPath(_fileName); 228string dirPath = Path.GetDirectoryName(fullPath)!; 229string fileNameOnly = Path.GetFileName(fullPath); 242fullPath = Path.Combine(dirPath, fileNameOnly);
System.Formats.Tar (47)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\Formats\Tar\TarEntry.cs (17)
300TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 324TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 333Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 338Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); 352Path.IsPathFullyQualified(linkName) ? linkName : Path.Join(Path.GetDirectoryName(fileDestinationPath), linkName)); 367Path.Join(destinationDirectoryPath, linkName)); 382Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 385string fullPath = Path.GetFullPath(qualifiedPath); // Removes relative segments 435Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 490string? directoryPath = Path.GetDirectoryName(filePath); 492if (!string.IsNullOrEmpty(directoryPath) && !Path.Exists(directoryPath)) 497if (!Path.Exists(filePath)) 520Debug.Assert(!Path.Exists(destinationFileName)); 536Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarFile.cs (14)
47sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 86sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 107sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 108destinationFileName = Path.GetFullPath(destinationFileName); 143sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 144destinationFileName = Path.GetFullPath(destinationFileName); 187destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 232destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 260sourceFileName = Path.GetFullPath(sourceFileName); 261destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 307sourceFileName = Path.GetFullPath(sourceFileName); 308destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 525Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 534Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath));
System\Formats\Tar\TarHeader.Write.cs (5)
1064ReadOnlySpan<char> dirName = Path.GetDirectoryName(_name.AsSpan()); 1067ReadOnlySpan<char> fileName = Path.GetFileName(_name.AsSpan()); 1071$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 1086ReadOnlySpan<char> tmp = Path.TrimEndingDirectorySeparator(Path.GetTempPath());
System\Formats\Tar\TarHelpers.cs (1)
447=> c == Path.DirectorySeparatorChar;
System\Formats\Tar\TarHelpers.Unix.cs (3)
25string filename = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System\Formats\Tar\TarWriter.cs (2)
373string fullPath = Path.GetFullPath(fileName); 374string? actualEntryName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(fileName) : entryName;
System.IO.Compression (2)
System\IO\Compression\ZipArchiveEntry.cs (2)
122_externalFileAttr = entryName.EndsWith(Path.DirectorySeparatorChar) || entryName.EndsWith(Path.AltDirectorySeparatorChar)
System.IO.Compression.ZipFile (11)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Compression\ZipFile.Create.cs (3)
442sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 443destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName); 464sourceDirectoryName = Path.GetFullPath(sourceDirectoryName);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.cs (6)
111if (!destinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar)) 113char sep = Path.DirectorySeparatorChar; 117string fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, ArchivingUtils.SanitizeEntryFilePath(source.FullName))); 122if (Path.GetFileName(fileDestinationPath).Length == 0) 135Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System.IO.FileSystem.DriveInfo (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.IO.FileSystem.Watcher (10)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\IO\FileSystemWatcher.cs (1)
390ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath);
System\IO\FileSystemWatcher.Linux.cs (4)
454AddDirectoryWatchUnlocked(directoryEntry, System.IO.Path.GetFileName(subDir)); 973if (c != System.IO.Path.DirectorySeparatorChar && c != System.IO.Path.AltDirectorySeparatorChar) 975builder.Append(System.IO.Path.DirectorySeparatorChar);
System.IO.IsolatedStorage (18)
System\IO\IsolatedStorage\Helper.cs (2)
71if (Path.GetFileName(directory)?.Length == 12) 75if (Path.GetFileName(subdirectory)?.Length == 12)
System\IO\IsolatedStorage\Helper.NonMobile.cs (4)
26dataDirectory = Path.Combine(dataDirectory, IsolatedStorageDirectoryName); 49randomDirectory = Path.Combine(rootDirectory, Path.GetRandomFileName(), Path.GetRandomFileName());
System\IO\IsolatedStorage\IsolatedStorage.cs (1)
115get { return Path.DirectorySeparatorChar; }
System\IO\IsolatedStorage\IsolatedStorageFile.cs (8)
177return Directory.EnumerateFiles(RootDirectory, searchPattern).Select(f => Path.GetFileName(f)).ToArray(); 201return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray(); 548if (partialPath[i] != Path.DirectorySeparatorChar && partialPath[i] != Path.AltDirectorySeparatorChar) 556return Path.Combine(RootDirectory, partialPath); 627parentDirectory = Path.GetDirectoryName(parentDirectory); 716private static bool IsIdFile(string file) => string.Equals(Path.GetFileName(file), "identity.dat"); 718private static bool IsInfoFile(string file) => string.Equals(Path.GetFileName(file), "info.dat");
System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs (3)
64string directoryName = Path.GetFileName(directory); 74return Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar));
System.IO.MemoryMappedFiles (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
275string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
System.IO.Pipes (8)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Pipes\PipeStream.Unix.cs (6)
27private static readonly char[] s_invalidFileNameChars = Path.GetInvalidFileNameChars(); 30private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars(); 33private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_"); 203if (Path.IsPathRooted(pipeName)) 205if (pipeName.AsSpan().ContainsAny(s_invalidPathNameChars) || pipeName.EndsWith(Path.DirectorySeparatorChar))
System.Net.Mail (5)
System\Net\Mail\Attachment.cs (3)
296Name = Path.GetFileName(fileName); 303Name = Path.GetFileName(fileName); 312Name = Path.GetFileName(fileName);
System\Net\Mail\SmtpClient.cs (2)
372if (!Path.IsPathRooted(pickupDirectory)) 379pathAndFilename = Path.Combine(pickupDirectory, filename);
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\LinuxIPGlobalStatistics.cs (1)
36string forwardingConfigFile = Path.Combine(NetworkFiles.Ipv6ConfigFolder,
System\Net\NetworkInformation\LinuxIPInterfaceStatistics.cs (1)
26string transmitQueueLengthFilePath = Path.Combine(NetworkFiles.SysClassNetFolder, name, NetworkFiles.TransmitQueueLengthFileName);
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
41Path.Join(NetworkFiles.Ipv4ConfigFolder, _linuxNetworkInterface.Name, NetworkFiles.ForwardingFileName),
System.Net.Ping (1)
src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (1)
28string path = Path.Combine(folder, fileName);
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
271string? dirname = Path.GetDirectoryName(fnfe.FileName);
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
153return new UnixDomainSocketEndPoint(_path, Path.GetFullPath(_path));
System.Net.WebClient (4)
System\Net\WebClient.cs (4)
478fileName = Path.GetFullPath(fileName); 507"Content-Disposition: form-data; name=\"file\"; filename=\"" + Path.GetFileName(fileName) + "\"\r\n" + // TODO: Should the filename path be encoded? 787return new Uri(Path.GetFullPath(address)); 792return new Uri(Path.GetFullPath(address));
System.Private.CoreLib (151)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (2)
27string? directory = Path.GetDirectoryName(path); 32if (!Path.EndsInDirectorySeparator(directory))
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
123string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (6)
130data = Path.Combine(home, ".local", "share"); 142return Path.Combine(home, ".fonts"); 157config = Path.Combine(home, ".config"); 181string userDirsPath = Path.Combine(GetXdgConfig(homeDir), "user-dirs.dirs"); 234Path.Combine(homeDir, path) : 246return Path.Combine(homeDir, fallback);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (18)
20string fullPath = Path.GetFullPath(path); 22string? s = Path.GetDirectoryName(fullPath); 32string fullPath = Path.GetFullPath(path); 89string fullPath = Path.GetFullPath(path); 102string fullPath = Path.GetFullPath(path); 108string fullPath = Path.GetFullPath(path); 124string fullPath = Path.GetFullPath(path); 130string fullPath = Path.GetFullPath(path); 146string fullPath = Path.GetFullPath(path); 152string fullPath = Path.GetFullPath(path); 253string fullPath = Path.GetFullPath(path); 254string root = Path.GetPathRoot(fullPath)!; 265Environment.CurrentDirectory = Path.GetFullPath(path); 273FileSystem.MoveDirectory(Path.GetFullPath(sourceDirName), Path.GetFullPath(destDirName)); 278string fullPath = Path.GetFullPath(path); 284string fullPath = Path.GetFullPath(path); 310string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
20string fullPath = Path.GetFullPath(path); 31string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (13)
20fullPath: Path.GetFullPath(path), 34fullPath = isNormalized ? fullPath : Path.GetFullPath(fullPath); 53Path.GetFileName(Path.TrimEndingDirectorySeparator(fullPath))).ToString(); 67string? parentName = Path.GetDirectoryName(PathInternal.IsRoot(FullPath.AsSpan()) ? FullPath : Path.TrimEndingDirectorySeparator(FullPath)); 80if (Path.IsPathRooted(path)) 83string newPath = Path.GetFullPath(Path.Combine(FullPath, path)); 85ReadOnlySpan<char> trimmedNewPath = Path.TrimEndingDirectorySeparator(newPath.AsSpan()); 86ReadOnlySpan<char> trimmedCurrentPath = Path.TrimEndingDirectorySeparator(FullPath.AsSpan()); 203public DirectoryInfo Root => new DirectoryInfo(Path.GetPathRoot(FullPath)!); 209string destination = Path.GetFullPath(destDirName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
84Path.TryJoin(Directory, FileName, _pathBuffer, out int charsWritten); 176Path.Join(originalRootDirectory, relativePath, fileName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs (4)
29if (Path.IsPathRooted(expression)) 45ReadOnlySpan<char> directoryName = Path.GetDirectoryName(expression.AsSpan()); 52directory = Path.Join(directory.AsSpan(), directoryName); 77if (Path.DirectorySeparatorChar != '\\' && expression.AsSpan().ContainsAny(@"\""<>"))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.cs (2)
37string path = isNormalized ? directory : Path.GetFullPath(directory); 38_rootDirectory = Path.TrimEndingDirectorySeparator(path);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
151_pending.Enqueue((Path.Join(_currentPath, entry.FileName), _remainingRecursionDepth - 1));
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (27)
56FileSystem.CopyFile(Path.GetFullPath(sourceFileName), Path.GetFullPath(destFileName), overwrite); 85FileSystem.DeleteFile(Path.GetFullPath(path)); 101path = Path.GetFullPath(path); 171return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize); 182=> FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false); 213=> FileSystem.SetCreationTime(Path.GetFullPath(path), GetUtcDateTimeOffset(creationTimeUtc), asDirectory: false); 245=> FileSystem.GetCreationTime(Path.GetFullPath(path)).LocalDateTime; 270=> FileSystem.GetCreationTime(Path.GetFullPath(path)).UtcDateTime; 295=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), lastAccessTime, false); 326=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastAccessTimeUtc), false); 357=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).LocalDateTime; 382=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).UtcDateTime; 407=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), lastWriteTime, false); 438=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastWriteTimeUtc), false); 469=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).LocalDateTime; 494=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).UtcDateTime; 519=> FileSystem.GetAttributes(Path.GetFullPath(path)); 543=> FileSystem.SetAttributes(Path.GetFullPath(path), fileAttributes); 699/// <paramref name="path"/> is a zero-length string, contains only white space, or contains one more invalid characters defined by the <see cref="System.IO.Path.GetInvalidPathChars"/> method. 723/// <paramref name="path"/> is a zero-length string, contains only white space, or contains one more invalid characters defined by the <see cref="System.IO.Path.GetInvalidPathChars"/> method. 860Path.GetFullPath(sourceFileName), 861Path.GetFullPath(destinationFileName), 862destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null, 882string fullSourceFileName = Path.GetFullPath(sourceFileName); 883string fullDestFileName = Path.GetFullPath(destFileName); 1193string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\IO\File.Unix.cs (2)
11=> FileSystem.GetUnixFileMode(Path.GetFullPath(path)); 17=> FileSystem.SetUnixFileMode(Path.GetFullPath(path), mode);
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (9)
28FullPath = isNormalized ? fullPath ?? originalPath : Path.GetFullPath(fullPath); 32public override string Name => _name ??= Path.GetFileName(OriginalPath); 46public string? DirectoryName => Path.GetDirectoryName(FullPath); 95string destinationPath = Path.GetFullPath(destFileName); 157string fullDestFileName = Path.GetFullPath(destFileName); 163if (!new DirectoryInfo(Path.GetDirectoryName(FullName)!).Exists) 173_name = Path.GetFileName(fullDestFileName); 188Path.GetFullPath(destinationFileName), 189destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (2)
191=> GetAttributes(handle, handle.Path, Path.GetFileName(handle.Path), continueOnError); 507Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.cs (4)
33ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 34ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 41Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator)))
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (1)
47fullPath = Path.TrimEndingDirectorySeparator(fullPath);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (9)
105if (!Directory.Exists(Path.GetDirectoryName(destFullPath))) 250string? directoryName = Path.GetDirectoryName(fullPath); 404ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 405ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 409if (OperatingSystem.IsBrowser() && Path.EndsInDirectorySeparator(sourceFullPath) && FileExists(sourceFullPath)) 434Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator))) // same names. 441&& Path.EndsInDirectorySeparator(sourceFullPath)) 729sb.Length = Path.GetDirectoryNameOffset(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
102string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
28return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 41s_userProductDirectory = Path.Combine(
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
42string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (5)
262string normalizedPath = Path.GetFullPath(path); 305requestorPath = Path.GetFullPath(requestorPath); 326string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath)!, requestedAssemblyName.Name + ".dll"); 360string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
71string path = Path.Combine(_mediator.ModuleDir, fileName);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (7)
101_assemblyPaths.TryAdd(Path.GetFileNameWithoutExtension(assemblyPath), assemblyPath); 107_assemblyDirectorySearchPaths = new string[1] { Path.GetDirectoryName(componentAssemblyPath)! }; 130string assemblyPath = Path.Combine( 163if (unmanagedDllName.Contains(Path.DirectorySeparatorChar)) 175bool isRelativePath = !Path.IsPathFullyQualified(unmanagedDllName); 181string libraryPath = Path.Combine(searchPath, libraryName); 200return pathsList.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
779string? parentDirectory = Path.GetDirectoryName(parentAssembly.Location); 783string assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!, $"{assemblyName.Name}.dll"); 794assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!.ToLowerInvariant(), $"{assemblyName.Name}.dll");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
36bool containsDelim = libName.Contains(Path.DirectorySeparatorChar);
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (6)
44startupHookParts.AddRange(diagnosticStartupHooks.Split(Path.PathSeparator)); 49startupHookParts.AddRange(startupHooksVariable.Split(Path.PathSeparator)); 90Path.DirectorySeparatorChar, 91Path.AltDirectorySeparatorChar, 101if (Path.IsPathFullyQualified(startupHookPart)) 146Debug.Assert(Path.IsPathFullyQualified(startupHook.Path));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (11)
75if (Path.IsPathRooted(id) || IdContainsAnyDisallowedChars(id)) 83string timeZoneFilePath = Path.Combine(timeZoneDirectory, id); 152var fileName = Path.Combine(GetTimeZoneDirectory(), TimeZoneFileName); 241symlinkPath = Path.GetFullPath(symlinkPath, Path.GetDirectoryName(tzFilePath)!); 261return Path.Join(currentPath.AsSpan(), direntName); 409string localtimeFilePath = Path.Combine(timeZoneDirectory, "localtime"); 410string posixrulesFilePath = Path.Combine(timeZoneDirectory, "posixrules"); 524TryLoadTzFile(Path.Combine(GetTimeZoneDirectory(), "localtime"), ref rawData, ref id); 541tzFilePath = Path.Combine(GetTimeZoneDirectory(), tzVariable); 599else if (!tzDirectory.EndsWith(Path.DirectorySeparatorChar))
src\System\Reflection\RuntimeModule.cs (1)
507int i = s.LastIndexOf(IO.Path.DirectorySeparatorChar);
System.Private.Xml (7)
System\Xml\Serialization\Compilation.cs (6)
235path = Path.Combine(Path.GetDirectoryName(type.Assembly.Location)!, $"{assemblyName}.dll"); 240path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, $"{assemblyName}.dll"); 245path = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, $"{assemblyName}.dll");
System\Xml\XmlResolver.cs (1)
48uri = new Uri(Path.GetFullPath(relativeUri!));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\PathUtilities.cs (2)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString(); 48/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> this method doesn't check for invalid path characters.</remarks>
System\Reflection\PortableExecutable\PEReader.cs (1)
729peImageDirectory = Path.GetDirectoryName(peImagePath);
System.Reflection.MetadataLoadContext (4)
System\Reflection\PathAssemblyResolver.cs (1)
42string file = Path.GetFileNameWithoutExtension(path);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.Modules.cs (2)
44string? directoryPath = Path.GetDirectoryName(location); 45string modulePath = Path.Combine(directoryPath!, moduleName);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
53int i = s.LastIndexOf(Path.DirectorySeparatorChar);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
313[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.Caching (2)
System\Runtime\Caching\FileChangeNotificationSystem.cs (2)
108string dir = Path.GetDirectoryName(filePath); 163string dir = Path.GetDirectoryName(filePath);
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
44[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\RuntimeEnvironment.cs (3)
22if (!Path.IsPathRooted(runtimeDirectory)) 27char sep = Path.DirectorySeparatorChar; 28return string.Concat(Path.GetDirectoryName(runtimeDirectory), new ReadOnlySpan<char>(in sep));
System.Security.Cryptography (11)
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
28return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 41s_userProductDirectory = Path.Combine(
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
327return Path.GetFullPath(rootFile); 337string[] directories = rootDirectory.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); 341directories[i] = Path.GetFullPath(directories[i]);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
307return Path.Combine(s_crlDir, localFileName);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (4)
203destinationFilename = Path.Combine(_storePath, thumbprint + PfxExtension); 304string builtPath = Path.Combine(_storePath, pathBuilder.ToString()); 326return Path.Combine(s_userStoreRoot, directoryName); 335string fileName = Path.GetFileName(storeName);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
417_ = Path.GetFullPath(fileName);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
27using StreamWriter sw = new StreamWriter($"{Path.Combine(path, classname)}.cs");
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
449Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
TaskUsageLogger (2)
TaskUsageLogger.cs (2)
256evaluatedTaskAssemblyPath = Path.GetFullPath(evaluatedTaskAssemblyPath); 405string projectExtension = Path.GetExtension(projectPath);
Templates.Blazor.Tests (43)
BlazorTemplateTest.cs (1)
63var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory);
BlazorWasmTemplateTest.cs (9)
33var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 34Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 194var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 198Assert.False(File.Exists(Path.Combine(publishDir, "service-worker.published.js")), "service-worker.published.js should not be published"); 199Assert.True(File.Exists(Path.Combine(publishDir, "service-worker.js")), "service-worker.js should be published"); 200Assert.True(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "service-worker-assets.js should be published"); 386var fullPath = Path.Combine(basePath, path); 390return File.ReadAllText(Path.Combine(basePath, path)); 395var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (1)
25var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 190var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 205var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 252var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 281var fullPath = Path.Combine(TemplateOutputDir, path); 407return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 523var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 525var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
42public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 46: Path.Combine("Hives", ".templateEngine")); 91.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 130var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
Templates.Blazor.WebAssembly.Auth.Tests (39)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (1)
25var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 190var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 205var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 252var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 281var fullPath = Path.Combine(TemplateOutputDir, path); 407return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 523var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 525var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
42public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 46: Path.Combine("Hives", ".templateEngine")); 91.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 130var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Shared\E2ETesting\BrowserFixture.cs (3)
164opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 232return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
122var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Blazor.WebAssembly.Tests (47)
BlazorWasmTemplateTest.cs (8)
33var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 34Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 43var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 44Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 53var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 54Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 63var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 64Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (1)
25var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 190var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 205var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 252var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 281var fullPath = Path.Combine(TemplateOutputDir, path); 407return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 523var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 525var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
42public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 46: Path.Combine("Hives", ".templateEngine")); 91.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 130var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Shared\E2ETesting\BrowserFixture.cs (3)
164opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 232return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
122var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Mvc.Tests (45)
BlazorTemplateTest.cs (4)
176var singleProjectPath = Path.Combine(project.TemplateOutputDir, $"{project.ProjectName}.csproj"); 182var multiProjectPath = Path.Combine(project.TemplateOutputDir, project.ProjectName, $"{project.ProjectName}.csproj"); 186project.TemplateOutputDir = Path.GetDirectoryName(multiProjectPath); 195var appRazorPath = Path.Combine(project.TemplateOutputDir, "Components", "App.razor");
RazorPagesTemplateTest.cs (2)
310var fullPath = Path.Combine(basePath, path); 314return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (1)
25var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 190var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 205var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 252var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 281var fullPath = Path.Combine(TemplateOutputDir, path); 407return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 523var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 525var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
42public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 46: Path.Combine("Hives", ".templateEngine")); 91.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 130var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Shared\E2ETesting\BrowserFixture.cs (3)
164opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 232return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
122var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Tests (47)
BaselineTest.cs (1)
121var fullPath = Path.Combine(basePath, path);
ByteOrderMarkTest.cs (5)
48var filePath = Path.GetFullPath(file); 86var filePath = Path.GetFullPath(file); 107var AssetsDir = Path.Combine(currentDirectory, "Assets"); 108var path = Path.Combine(projectName, "content"); 109var templateDirectoryPath = Path.Combine(AssetsDir, path);
IdentityUIPackageTest.cs (2)
161var fullPath = Path.Combine(basePath, path); 165return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (1)
25var certificatePath = Path.Combine(workingDirectory, $"{Guid.NewGuid()}.pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 190var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 205var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 252var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 281var fullPath = Path.Combine(TemplateOutputDir, path); 407return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 523var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 525var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
42public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 46: Path.Combine("Hives", ".templateEngine")); 91.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 130var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (4)
470var targetDirectoryPath = Path.GetDirectoryName(path); 556var tempFilename = Path.GetTempFileName(); 578var keyPath = Path.ChangeExtension(path, ".key"); 584var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
26private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 91var tmpFile = Path.GetTempFileName(); 149var tmpFile = Path.GetTempFileName(); 196var certificatePath = Path.GetTempFileName(); 337var certificatePath = Path.GetTempFileName(); 369Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
src\Shared\E2ETesting\BrowserFixture.cs (3)
164opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 232return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
122var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
TestExclusionListTasks (68)
PatchExclusionListInApks.cs (1)
43apkBuilder.OutputDir = Path.GetDirectoryName(apkPath)!;
src\tasks\AndroidAppBuilder\ApkBuilder.cs (61)
62if (!string.IsNullOrEmpty(mainLibraryFileName) && !File.Exists(Path.Combine(AppDir, mainLibraryFileName))) 137string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 158var name = Path.GetFileNameWithoutExtension(obj); 165var name = Path.GetFileNameWithoutExtension(llvmObj); 182Directory.CreateDirectory(Path.Combine(OutputDir, "bin")); 183Directory.CreateDirectory(Path.Combine(OutputDir, "obj")); 184Directory.CreateDirectory(Path.Combine(OutputDir, "assets-tozip")); 185Directory.CreateDirectory(Path.Combine(OutputDir, "assets")); 196var assetsToZipDirectory = Path.Combine(OutputDir, "assets-tozip"); 200string fileName = Path.GetFileName(file); 201string extension = Path.GetExtension(file); 220File.Copy(aotlib, Path.Combine(assetsToZipDirectory, Path.GetFileName(aotlib))); 224string dx = Path.Combine(buildToolsFolder, "dx"); 225string d8 = Path.Combine(buildToolsFolder, "d8"); 226string aapt = Path.Combine(buildToolsFolder, "aapt"); 227string zipalign = Path.Combine(buildToolsFolder, "zipalign"); 228string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 229string androidJar = Path.Combine(AndroidSdk, "platforms", "android-" + BuildApiLevel, "android.jar"); 230string androidToolchain = Path.Combine(AndroidNdk, "build", "cmake", "android.toolchain.cmake"); 252monoRuntimeLib = Path.Combine(AppDir, "libmonosgen-2.0.a"); 256monoRuntimeLib = Path.Combine(AppDir, "libmonosgen-2.0.so"); 349File.WriteAllText(Path.Combine(OutputDir, "CMakeLists.txt"), cmakeLists); 350File.WriteAllText(Path.Combine(OutputDir, monodroidSource), Utils.GetEmbeddedResource(monodroidSource)); 360string javaSrcFolder = Path.Combine(OutputDir, "src", "net", "dot"); 363string javaActivityPath = Path.Combine(javaSrcFolder, "MainActivity.java"); 364string monoRunnerPath = Path.Combine(javaSrcFolder, "MonoRunner.java"); 377.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName))); 392.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName)) 398File.WriteAllText(Path.Combine(OutputDir, "AndroidManifest.xml"), 410string[] classFiles = Directory.GetFiles(Path.Combine(OutputDir, "obj"), "*.class", SearchOption.AllDirectories); 425string apkFile = Path.Combine(OutputDir, "bin", $"{ProjectName}.unaligned.apk"); 429dynamicLibs.Add(Path.Combine(OutputDir, "monodroid", "libmonodroid.so")); 437dynamicLibs.AddRange(Directory.GetFiles(AppDir, "*.so").Where(file => Path.GetFileName(file) != "libmonodroid.so")); 441Directory.CreateDirectory(Path.Combine(OutputDir, "lib", abi)); 444string dynamicLibName = Path.GetFileName(dynamicLib); 445string destRelative = Path.Combine("lib", abi, dynamicLibName); 482File.Copy(dynamicLib, Path.Combine(OutputDir, destRelative), true); 493File.Copy(dexFile, Path.Combine(OutputDir, classesFileName)); 494logger.LogMessage(MessageImportance.High, $"Adding dex file {Path.GetFileName(dexFile)} as {classesFileName}"); 500string alignedApk = Path.Combine(OutputDir, "bin", $"{ProjectName}.apk"); 520string defaultKey = Path.Combine(OutputDir, "debug.keystore"); 522defaultKey : Path.Combine(KeyStorePath, "debug.keystore"); 530else if (Path.GetFullPath(signingKey) != Path.GetFullPath(defaultKey)) 532File.Copy(signingKey, Path.Combine(OutputDir, "debug.keystore")); 552string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 553string zipalign = Path.Combine(buildToolsFolder, "zipalign"); 554string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 577string buildToolsFolder = Path.Combine(AndroidSdk, "build-tools", BuildToolsVersion); 578string aapt = Path.Combine(buildToolsFolder, "aapt"); 579string apksigner = Path.Combine(buildToolsFolder, "apksigner"); 583apkPath = Directory.GetFiles(Path.Combine(OutputDir, "bin"), "*.apk").First(); 585apkPath = Path.Combine(OutputDir, "bin", $"{ProjectName}.apk"); 590Utils.RunProcess(logger, aapt, $"remove -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir); 591Utils.RunProcess(logger, aapt, $"add -v bin/{Path.GetFileName(apkPath)} {file}", workingDir: OutputDir); 602string? buildTools = Directory.GetDirectories(Path.Combine(androidSdkDir, "build-tools")) 603.Select(Path.GetFileName) 605.Select(file => { Version.TryParse(Path.GetFileName(file), out Version? version); return version; }) 620return Directory.GetDirectories(Path.Combine(androidSdkDir, "platforms")) 621.Select(file => int.TryParse(Path.GetFileName(file).Replace("android-", ""), out int apiLevel) ? apiLevel : -1)
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
TestTasks (3)
InjectRequestHandler.cs (3)
59var outputFolder = Path.GetDirectoryName(depsFile); 61File.Copy(Path.Combine(outputFolder, bitnessString, aspnetcoreV2Name), Path.Combine(outputFolder, aspnetcoreV2Name), overwrite: true);
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
325return System.IO.Path.GetFileName(sb.ToString().ToLower(CultureInfo.InvariantCulture));
Wasm.Performance.ConsoleHost (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
50&& string.Equals(Path.GetFileName(mainModule!), fileName, StringComparison.OrdinalIgnoreCase))
Wasm.Performance.Driver (6)
Program.cs (1)
263Path.GetFullPath(typeof(Program).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
src\Components\WebAssembly\DevServer\src\Server\Program.cs (4)
28var applicationDirectory = Path.GetDirectoryName(applicationPath)!; 29var name = Path.ChangeExtension(applicationPath, ".staticwebassets.runtime.json"); 30name = !File.Exists(name) ? Path.ChangeExtension(applicationPath, ".StaticWebAssets.xml") : name; 42config.AddJsonFile(Path.Combine(applicationDirectory, "blazor-devserversettings.json"), optional: true, reloadOnChange: true);
src\Components\WebAssembly\DevServer\src\Server\Startup.cs (1)
40string fileExtension = Path.GetExtension(ctx.Request.Path);
WasmAppBuilder (76)
EmccCompile.cs (7)
130_tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 193string tmpObjFile = Path.GetTempFileName(); 211label: Path.GetFileName(srcFile)); 229Log.LogMessage(MessageImportance.High, $"[{count}/{_totalFiles}] {Path.GetFileName(srcFile)} -> {Path.GetFileName(objFile)} [took {elapsedSecs:F}s]");
RunWithEmSdkEnv.cs (2)
28string envScriptPath = Path.Combine(EmSdkPath, "emsdk_env.cmd"); 36string envScriptPath = Path.Combine(EmSdkPath, "emsdk_env.sh");
src\tasks\Common\TempFileName.cs (1)
10public TempFileName() => Path = System.IO.Path.GetTempFileName();
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
src\tasks\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks\BootJsonBuilderHelper.cs (1)
56string resourceExtension = Path.GetExtension(resourceName);
wasi\WasiAppBuilder.cs (17)
57MainAssemblyName = Path.GetFileName(MainAssemblyName); 64string asmRootPath = Path.Combine(AppDir, "managed"); 68FileCopyChecked(assembly, Path.Combine(asmRootPath, Path.GetFileName(assembly)), "Assemblies"); 72string pdb = Path.ChangeExtension(assembly, ".pdb"); 74FileCopyChecked(pdb, Path.Combine(asmRootPath, Path.GetFileName(pdb)), "Assemblies"); 82string dest = Path.Combine(AppDir, Path.GetFileName(item.ItemSpec)); 89string name = Path.GetFileName(args.fullPath); 90string directory = Path.Combine(AppDir, "managed", args.culture); 92FileCopyChecked(args.fullPath, Path.Combine(directory, name), "SatelliteAssemblies"); 100Directory.CreateDirectory(Path.Combine(AppDir, "tmp")); 115dst = Path.Combine(AppDir!, tgtPath); 116string? dstDir = Path.GetDirectoryName(dst); 122dst = Path.Combine(AppDir!, Path.GetFileName(src));
WasmAppBuilder.cs (37)
110MainAssemblyName = Path.GetFileName(MainAssemblyName); 123? Path.Combine(AppDir, RuntimeAssetsLocation) 141var finalWebcil = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); 150FileCopyChecked(assembly, Path.Combine(runtimeAssetsPath, Path.GetFileName(assembly)), "Assemblies"); 155pdb = Path.ChangeExtension(pdb, ".pdb"); 157FileCopyChecked(pdb, Path.Combine(runtimeAssetsPath, Path.GetFileName(pdb)), "Assemblies"); 163var name = Path.GetFileName(item.ItemSpec); 164var dest = Path.Combine(runtimeAssetsPath, name); 184string packageJsonPath = Path.Combine(AppDir, "package.json"); 204assemblyPath = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); 209bootConfig.resources.assembly[Path.GetFileName(assemblyPath)] = Utils.ComputeIntegrity(bytes); 212var pdb = Path.ChangeExtension(assembly, ".pdb"); 218bootConfig.resources.pdb[Path.GetFileName(pdb)] = Utils.ComputeIntegrity(pdb); 231string name = Path.GetFileName(args.fullPath); 232string cultureDirectory = Path.Combine(runtimeAssetsPath, args.culture); 239var finalWebcil = Path.Combine(cultureDirectory, Path.ChangeExtension(name, Utils.WebcilInWasmExtension)); 249cultureSatelliteResources[Path.GetFileName(finalWebcil)] = Utils.ComputeIntegrity(finalWebcil); 253var satellitePath = Path.Combine(cultureDirectory, name); 265string supportFilesDir = Path.Combine(runtimeAssetsPath, "supportFiles"); 276targetPath = Path.GetFileName(item.ItemSpec); 283string firstPath = Path.GetFullPath(targetPathTable[targetPath]!); 284string secondPath = Path.GetFullPath(item.ItemSpec); 297var generatedFileName = $"{i++}_{Path.GetFileName(item.ItemSpec)}"; 298var vfsPath = Path.Combine(supportFilesDir, generatedFileName); 323bootConfig.resources.icu[Path.GetFileName(idfn)] = Utils.ComputeIntegrity(idfn); 396string monoConfigPath = Path.Combine(runtimeAssetsPath, "blazor.boot.json"); // TODO: Unify with Wasm SDK 408dst = Path.Combine(AppDir!, tgtPath); 409string? dstDir = Path.GetDirectoryName(dst); 415dst = Path.Combine(AppDir!, Path.GetFileName(src));
WasmAppBuilderBaseTask.cs (3)
102string[] matchingAssemblies = Assemblies.Where(asm => Path.GetFileName(asm) == MainAssemblyName).ToArray(); 157string dstPath = Path.Combine(AppDir!, Path.GetFileName(RuntimeConfigJsonPath));
WasmLoadAssembliesAndReferences.cs (2)
47var asmFullPath = Path.GetFullPath(asm); 106string path = Path.Combine(dir, name + ".dll");
WasmBuildTasks (2)
GenerateAOTProps.cs (1)
51var outDir = Path.GetDirectoryName(OutputFile);
UpdateChromeVersions.cs (1)
243string filePath = Path.Combine(IntermediateOutputPath, filename);
WorkloadBuildTasks (32)
InstallWorkloadFromArtifacts.cs (16)
50private string AllManifestsStampPath => Path.Combine(SdkWithNoWorkloadInstalledPath, ".all-manifests.stamp"); 64_tempDir = Path.Combine(IntermediateOutputPath ?? Path.GetTempPath(), $"workload-{Path.GetRandomFileName()}"); 68_nugetCachePath = Path.Combine(_tempDir, "nuget-cache"); 220string nugetConfigPath = Path.Combine(_tempDir, $"NuGet.{Path.GetRandomFileName()}.config"); 232Path.Combine(req.TargetPath, "dotnet"), 255foreach (string dir in Directory.EnumerateDirectories(Path.Combine(req.TargetPath, "sdk-manifests"), "*", SearchOption.AllDirectories)) 256Log.LogMessage(MessageImportance.Low, $"\t{Path.Combine(req.TargetPath, "sdk-manifests", dir)}"); 258foreach (string dir in Directory.EnumerateDirectories(Path.Combine(req.TargetPath, "packs"), "*", SearchOption.AllDirectories)) 259Log.LogMessage(MessageImportance.Low, $"\t{Path.Combine(req.TargetPath, "packs", dir)}"); 267var nugetConfigPath = Path.GetTempFileName(); 282string manifestVersionBandDir = Path.Combine(sdkDir, "sdk-manifests", VersionBandForSdkManifestsDir); 307string jsonPath = Path.Combine(manifestDir, "WorkloadManifest.json"); 371return first ?? Path.Combine(parentDir, dirName.ToLower(CultureInfo.InvariantCulture));
PackageInstaller.cs (10)
30_tempDir = Path.Combine(baseTempDir, Path.GetRandomFileName()); 31_packagesDir = packagesPath ?? Path.Combine(_tempDir, "nuget-packages"); 52var projecDir = Path.Combine(_tempDir, "restore"); 53var projectPath = Path.Combine(projecDir, "Restore.csproj"); 57File.WriteAllText(Path.Combine(projecDir, "Directory.Build.props"), """ 70File.WriteAllText(Path.Combine(projecDir, "nuget.config"), _nugetConfigContents); 74string args = $"restore \"{projectPath}\" /p:RestorePackagesPath=\"{_packagesDir}\" /bl:{Path.Combine(_tempDir, "restore.binlog")}"; 83.Select(r => (r, Path.Combine(_packagesDir, r.Name.ToLowerInvariant(), r.Version))) 103var source = Path.Combine(_packagesDir, pkgRef.Name.ToLowerInvariant(), pkgRef.Version, pkgRef.relativeSourceDir);
src\tasks\Common\Utils.cs (6)
83string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); 341string relativePath = Path.GetRelativePath(sourceDir, file); 342string? relativeDir = Path.GetDirectoryName(relativePath); 344Directory.CreateDirectory(Path.Combine(destDir, relativeDir)); 346File.Copy(file, Path.Combine(destDir, relativePath), true);
xunit.console (39)
CommandLine.cs (2)
83return Path.GetFullPath(fileName); 511var directory = Path.GetDirectoryName(path);
common\AssemblyResolution\AssemblyHelper.cs (1)
54var assemblyFolder = Path.GetDirectoryName(assemblyFileName);
common\AssemblyResolution\DependencyContextAssemblyCache.cs (8)
72.Select(path => Tuple.Create(Path.GetFileNameWithoutExtension(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 86.Select(path => Tuple.Create(Path.GetFileName(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 211var assemblyPath = Path.Combine(Path.GetFullPath(assemblyFolder), assemblyName); 238var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(assemblyName, Path.GetFileNameWithoutExtension(a), StringComparison.OrdinalIgnoreCase)); 241resolvedAssemblyPath = Path.GetFullPath(resolvedAssemblyPath); 281var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(formattedUnmanagedDllName, Path.GetFileName(a), StringComparison.OrdinalIgnoreCase)); 283return Path.GetFullPath(resolvedAssemblyPath);
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (2)
402groupRuntimeAssemblies.Where(a => Path.GetFileName(a) != "_._"))); 414groupNativeLibraries.Where(a => Path.GetFileName(a) != "_._")));
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
116var depsJsonFile = Path.ChangeExtension(assembly.Location, DepsJsonExtension);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\AppBaseCompilationAssemblyResolver.cs (4)
50var refsPath = Path.Combine(_basePath, RefsDirectoryName); 73var sharedDirectory = Path.GetDirectoryName(sharedPath); 74var sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 87var assemblyFile = Path.GetFileName(assembly);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split(new char [] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries ); 74return new string[] { Path.Combine(basePath, ".nuget", "packages") };
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ReferenceAssemblyPathResolver.cs (5)
65var relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 73var name = Path.GetFileName(path); 76var fallbackFile = Path.Combine(fallbackPath, name); 94var net20Dir = Path.Combine(environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v2.0.50727"); 135return Path.Combine(
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ResolverUtils.cs (4)
15path = Path.Combine(library.Name.ToLowerInvariant(), library.Version.ToLowerInvariant()); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.GetFullPath(Path.Combine(basePath, assemblyPath));
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (2)
36results = probeDirectories.Split(new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries).ToList(); 54results.Add(Path.Combine(basePath, ".nuget", "packages"));
ConsoleRunner.cs (7)
61if (!defaultDirectory.EndsWith(new string(new[] { Path.DirectorySeparatorChar }), StringComparison.Ordinal)) 62defaultDirectory += Path.DirectorySeparatorChar; 130var runnerPath = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); 137foreach (var dllFile in Directory.GetFiles(runnerPath, "*.dll").Select(f => Path.Combine(runnerPath, f))) 143var assembly = Assembly.Load(new AssemblyName(Path.GetFileNameWithoutExtension(dllFile))); 358var assemblyDisplayName = Path.GetFileNameWithoutExtension(assembly.AssemblyFilename); 383completionMessages.TryAdd(Path.GetFileName(assembly.AssemblyFilename), new ExecutionSummary());