490 references to FileUtilities
Microsoft.Build.Tasks.Core (164)
AppConfig\AppConfig.cs (1)
32appConfigFilePath = FileUtilities.NormalizePath(appConfigFilePath);
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigCache.cs (1)
49.Where(assemblyFolder => FileUtilities.DirectoryExistsNoThrow(assemblyFolder.DirectoryPath))
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
63bool allowedExtension = FileUtilities.HasExtension(candidateAssemblyFile, executableExtensions);
AssemblyDependency\GenerateBindingRedirects.cs (1)
138using (var stream = FileUtilities.OpenWrite(OutputAppConfigFile.ItemSpec, false))
AssemblyDependency\HintPathResolver.cs (2)
45if (!string.IsNullOrEmpty(hintPath) && !FileUtilities.PathIsInvalid(hintPath)) 47if (ResolveAsFile(FileUtilities.NormalizePath(hintPath), assemblyName, isPrimaryProjectReference, wantSpecificVersion, true, assembliesConsideredAndRejected))
AssemblyDependency\Reference.cs (1)
524_fullPath = FileUtilities.NormalizePath(_fullPath);
AssemblyDependency\ReferenceTable.cs (4)
852name = item.GetMetadata(FileUtilities.ItemSpecModifiers.Filename); 1335resolvedPath = FileUtilities.NormalizePath(resolvedPath); 1700string referenceDirectoryName = FileUtilities.EnsureTrailingSlash(reference.DirectoryName); 2761item.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile)));
AssemblyDependency\ResolveAssemblyReference.cs (4)
1496if (FileUtilities.HasExtension(file, _allowedAssemblyExtensions)) 2196_targetFrameworkDirectories[i] = FileUtilities.EnsureTrailingSlash(_targetFrameworkDirectories[i]); 3210p => FileUtilities.FileExistsNoThrow(p), 3211p => FileUtilities.DirectoryExistsNoThrow(p),
AssignLinkMetadata.cs (3)
47string definingProject = item.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 48string definingProjectDirectory = item.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectDirectory); 49string fullPath = item.GetMetadata(FileUtilities.ItemSpecModifiers.FullPath);
AssignTargetPath.cs (1)
58fullRootPath = FileUtilities.EnsureTrailingSlash(fullRootPath);
BuildEnvironmentHelper.cs (9)
150var vsRoot = FileUtilities.GetFolderAbove(vsProcess, 3); 202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 360return FileUtilities.GetFolderAbove(msBuildAssembly, 369return FileUtilities.CombinePaths( 445return FileUtilities.ExecutingAssemblyPath; 604var potentialAmd64FromX86 = FileUtilities.CombinePaths(MSBuildToolsDirectoryRoot, "amd64", msBuildExeName); 605var potentialARM64FromX86 = FileUtilities.CombinePaths(MSBuildToolsDirectoryRoot, "arm64", msBuildExeName); 677defaultSdkPath = FileUtilities.CombinePaths(VisualStudioInstallRootDirectory, "MSBuild", "Sdks");
Copy.cs (4)
294FileUtilities.DeleteNoThrow(destinationFileState.Name); 754string src = FileUtilities.NormalizePath(sourceFolder.ItemSpec); 1038if (string.Equals(source.Name, destination.Name, FileUtilities.PathComparison)) 1045return string.Equals(source.FileNameFullPath, destination.FileNameFullPath, FileUtilities.PathComparison);
CreateCSharpManifestResourceName.cs (3)
97string embeddedFileName = FileUtilities.FixFilePath(linkFileName); 100embeddedFileName = FileUtilities.FixFilePath(fileName); 103dependentUponFileName = FileUtilities.FixFilePath(dependentUponFileName);
CreateItem.cs (2)
119if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(nameAndValue.Key)) 193newItem.SetMetadata(FileUtilities.ItemSpecModifiers.RecursiveDir, match.wildcardDirectoryPart);
DebugUtils.cs (5)
32string environmentDebugPath = FileUtilities.TrimAndStripAnyQuotes(Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH")); 37if (!string.IsNullOrWhiteSpace(debugDirectory) && FileUtilities.CanWriteToDirectory(debugDirectory)) 41else if (FileUtilities.CanWriteToDirectory(Directory.GetCurrentDirectory())) 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 59FileUtilities.EnsureDirectoryExists(debugDirectory);
Delete.cs (1)
107var deletedFilesSet = new HashSet<string>(FileUtilities.PathComparer);
DependencyFile.cs (2)
64this.filename = FileUtilities.FixFilePath(filename); 87FileInfo info = FileUtilities.GetFileInfoNoThrow(filename);
ErrorUtilities.cs (1)
542if (FileUtilities.PathIsInvalid(parameter))
ExceptionHandling.cs (3)
74: FileUtilities.TempFileDirectory; 359using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true)) 366using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true))
Exec.cs (2)
199_batchFile = FileUtilities.GetTemporaryFileName(".exec.cmd"); 208using (StreamWriter sw = FileUtilities.OpenWrite(_batchFile, false, encoding))
FileIO\WriteLinesToFile.cs (2)
99var directoryPath = Path.GetDirectoryName(FileUtilities.NormalizePath(File.ItemSpec)); 111if (FileUtilities.FileExistsNoThrow(File.ItemSpec))
FileMatcher.cs (17)
39internal static readonly char[] directorySeparatorCharacters = FileUtilities.Slashes; 224path = FileUtilities.FixFilePath(path); 588filespec = FileUtilities.FixFilePath(filespec); 862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1237bool isSurroundedBySlashes = (i == 0 || FileUtilities.IsAnySlash(str[i - 1])) 1238&& i < str.Length - 2 && FileUtilities.IsAnySlash(str[i + 2]); 1374else if (FileUtilities.IsAnySlash(ch)) 1419if (startIndex >= str.Length || !FileUtilities.IsAnySlash(str[startIndex])) 1428bool isSeparator = i < str.Length - 1 && FileUtilities.IsAnySlash(str[i + 1]); 1429bool isRelativeSeparator = i < str.Length - 2 && str[i + 1] == '.' && FileUtilities.IsAnySlash(str[i + 2]); 2127FileUtilities.IsAnySlash(wildcard[2]) && 2128FileUtilities.IsAnySlash(wildcard[wildcardLength - 3]) && 2133if (wildcard.IndexOfAny(FileUtilities.Slashes, 3, wildcardLength - 6) == -1) 2294if (!FileUtilities.IsAnySlash(directoryPart[i])) 2324while (index < aString.Length && FileUtilities.IsAnySlash(aString[index])) 2341if (FileUtilities.PathsEqual(filespecUnescaped, excludeSpec)) 2657int index = directoryPath.LastIndexOfAny(FileUtilities.Slashes);
FileState.cs (1)
86_filename = FileUtilities.AttemptToShortenPath(filename); // This is no-op unless the path actually is too long
FileUtilities.cs (1)
747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly));
FindInList.cs (1)
107var path = FileUtilities.FixFilePath(item.ItemSpec);
GenerateResource.cs (15)
2599_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), 0, 0, 0, 0, 2605_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), 0, 0, 0, 0, 2613_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), xe.LineNumber, 2618_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), 0, 0, 0, 0, 2632_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), xe.LineNumber, 2643_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), 0, 0, 0, 0, 2648FileUtilities.GetFullPathNoThrow(inFile)); 2654_logger.LogErrorWithCodeFromResources(null, FileUtilities.GetFullPathNoThrow(inFile), 0, 0, 0, 0, 2767FileUtilities.GetFullPathNoThrow(currentOutputFile), io.Message); 2801FileUtilities.GetFullPathNoThrow(inFile), e.Message); // Input file is more useful to log 2805FileUtilities.GetFullPathNoThrow(inFile)); 2812FileUtilities.GetFullPathNoThrow(currentOutputFile), e.Message); 2890_logger.LogMessageFromResources("GenerateResource.CorruptOutput", FileUtilities.GetFullPathNoThrow(filename)); 2897_logger.LogWarningWithCodeFromResources("GenerateResource.DeleteCorruptOutputFailed", FileUtilities.GetFullPathNoThrow(filename), deleteException.Message); 3804using (StreamWriter writer = FileUtilities.OpenWrite(fileName, false, Encoding.UTF8))
GetSDKReferenceFiles.cs (13)
84private string _cacheFilePath = FileUtilities.TempFileDirectory; 235return Execute(AssemblyNameExtension.GetAssemblyNameEx, AssemblyInformation.GetRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: false); 516if (FileUtilities.FileExistsNoThrow(xmlFile)) 570if (info.DirectoryToFileList != null && info.DirectoryToFileList.TryGetValue(FileUtilities.EnsureNoTrailingSlash(path), out List<string> referenceFiles) && referenceFiles != null) 622if (FileUtilities.EnsureTrailingSlash(directoryToFileList.Key).StartsWith(FileUtilities.EnsureTrailingSlash(redistFilePath), StringComparison.OrdinalIgnoreCase)) 629string relativeToBase = FileUtilities.MakeRelative(redistFilePath, file); 1018var cacheInfo = new SDKInfo(references, directoryToFileList, FileUtilities.GetPathsHash(directoriesToHash)); 1084int hash = FileUtilities.GetPathsHash(directoriesToHash); 1154string identityHash = FileUtilities.GetHexHash(sdkIdentity); 1155string rootHash = FileUtilities.GetHexHash(sdkRoot); 1166if (FileUtilities.DirectoryExistsNoThrow(redistPath)) 1180if (FileUtilities.DirectoryExistsNoThrow(referencesPath))
ListOperators\FindUnderPath.cs (3)
62System.IO.Path.GetFullPath(FileUtilities.FixFilePath(Path.ItemSpec))); 63conePath = FileUtilities.EnsureTrailingSlash(conePath); 83System.IO.Path.GetFullPath(FileUtilities.FixFilePath(item.ItemSpec)));
MakeDir.cs (2)
62if (!FileUtilities.DirectoryExistsNoThrow(directory.ItemSpec)) 73Directory.CreateDirectory(FileUtilities.FixFilePath(directory.ItemSpec));
ManifestUtil\ManifestWriter.cs (1)
127string temp = FileUtilities.GetTemporaryFileName();
ManifestUtil\Util.cs (2)
590string path = FileUtilities.GetTemporaryFileName(); 599string path = FileUtilities.GetTemporaryFileName();
Modifiers.cs (31)
110if (name == FileUtilities.ItemSpecModifiers.RootDir) 126if (name == FileUtilities.ItemSpecModifiers.FullPath) 130if (name == FileUtilities.ItemSpecModifiers.Filename) 138if (name == FileUtilities.ItemSpecModifiers.Identity) 153if (name == FileUtilities.ItemSpecModifiers.Directory) 161if (name == FileUtilities.ItemSpecModifiers.Extension) 176if (name == FileUtilities.ItemSpecModifiers.CreatedTime) 184if (name == FileUtilities.ItemSpecModifiers.RelativeDir) 200if (name == FileUtilities.ItemSpecModifiers.AccessedTime) 208if (name == FileUtilities.ItemSpecModifiers.ModifiedTime) 216if (name == FileUtilities.ItemSpecModifiers.RecursiveDir) 256if (name == FileUtilities.ItemSpecModifiers.DefiningProjectName) 262if (name == FileUtilities.ItemSpecModifiers.DefiningProjectFullPath) 274if (name == FileUtilities.ItemSpecModifiers.DefiningProjectDirectory) 282if (name == FileUtilities.ItemSpecModifiers.DefiningProjectExtension) 392if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.FullPath, StringComparison.OrdinalIgnoreCase)) 409else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RootDir, StringComparison.OrdinalIgnoreCase)) 425else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Filename, StringComparison.OrdinalIgnoreCase)) 440else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Extension, StringComparison.OrdinalIgnoreCase)) 454else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RelativeDir, StringComparison.OrdinalIgnoreCase)) 458else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Directory, StringComparison.OrdinalIgnoreCase)) 495else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase)) 500else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Identity, StringComparison.OrdinalIgnoreCase)) 504else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.ModifiedTime, StringComparison.OrdinalIgnoreCase)) 510FileInfo info = FileUtilities.GetFileInfoNoThrow(unescapedItemSpec); 522else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.CreatedTime, StringComparison.OrdinalIgnoreCase)) 538else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.AccessedTime, StringComparison.OrdinalIgnoreCase)) 563if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectDirectory, StringComparison.OrdinalIgnoreCase)) 574if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectFullPath, StringComparison.OrdinalIgnoreCase)) 578else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectName, StringComparison.OrdinalIgnoreCase)) 582else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectExtension, StringComparison.OrdinalIgnoreCase))
MSBuild.cs (4)
282string projectPath = FileUtilities.AttemptToShortenPath(project.ItemSpec); 310if (FileUtilities.IsVCProjFilename(projectPath)) 509string projectPath = FileUtilities.AttemptToShortenPath(projects[i].ItemSpec); 654outputItemFromTarget.SetMetadata(ItemMetadataNames.msbuildSourceProjectFile, projects[i].GetMetadata(FileUtilities.ItemSpecModifiers.FullPath));
PrintLineDebuggerWriters.cs (1)
74var executingAssembly = FileUtilities.ExecutingAssemblyPath;
RedistList.cs (2)
942Path = FileUtilities.NormalizeForPathComparison(path); 943FrameworkDirectory = FileUtilities.NormalizeForPathComparison(frameworkDirectory);
ResGenDependencies.cs (1)
373var outputFile = new FileInfo(FileUtilities.FixFilePath(outputFileName));
ResolveSDKReference.cs (1)
915ResolvedPath = FileUtilities.EnsureTrailingSlash(sdk.ItemSpec);
ResourceHandling\MSBuildResXReader.cs (3)
226string fileName = FileUtilities.FixFilePath(fileRefInfo[0]); 232FileUtilities.GetDirectory( 233FileUtilities.NormalizePath(resxFilename)),
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (2)
679string sourceCodePath = FileUtilities.GetTemporaryFileName(".tmp"); 680string assemblyPath = FileUtilities.GetTemporaryFileName(".dll");
SolutionConfiguration.cs (1)
60projectAbsolutePath = FileUtilities.GetFullPathNoThrow(projectAbsolutePath);
SystemState.cs (2)
613instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value); 617if (FileUtilities.FileExistsNoThrow(stateFile))
TempFileUtilities.cs (1)
74return FileUtilities.EnsureTrailingSlash(basePath);
Touch.cs (1)
94string path = FileUtilities.FixFilePath(file.ItemSpec);
Unzip.cs (3)
163string fullDestinationDirectoryPath = Path.GetFullPath(FileUtilities.EnsureTrailingSlash(destinationDirectory.FullName)); 174ErrorUtilities.VerifyThrowInvalidOperation(fullDestinationPath.StartsWith(fullDestinationDirectoryPath, FileUtilities.PathComparison), "Unzip.ZipSlipExploit", fullDestinationPath); 330else if (pattern.IndexOfAny(FileUtilities.InvalidPathChars) != -1)
WriteCodeFragment.cs (2)
114OutputFile ??= new TaskItem(FileUtilities.GetTemporaryFile(OutputDirectory.ItemSpec, null, extension)); 116FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(OutputFile.ItemSpec));
Microsoft.Build.Tasks.UnitTests (326)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (1)
39FileUtilities.DeleteNoThrow(_rarCacheFile);
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (5)
2940string appConfigFile = FileUtilities.GetTemporaryFileName() + appConfigNameSuffix; 3092if (FileUtilities.FileExistsNoThrow(t.StateFile)) 3115FileUtilities.DeleteNoThrow(redistListPath); 3120FileUtilities.DeleteNoThrow(rarCacheFile); 3150string redistFile = FileUtilities.GetTemporaryFileName();
Copy_Tests.cs (80)
488string file = FileUtilities.GetTemporaryFile(); 491using (StreamWriter sw = FileUtilities.OpenWrite(file, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 532string source = FileUtilities.GetTemporaryFile(); 533string destination = FileUtilities.GetTemporaryFile(null, ".tmp", false); 538using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 565Assert.False(FileUtilities.FileExistsNoThrow(destination)); 580string source = FileUtilities.GetTemporaryFile(); 581string destination = FileUtilities.GetTemporaryFile(); 587using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 592using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 641string source = FileUtilities.GetTemporaryFile(); 642string destination = FileUtilities.GetTemporaryFile(); 645using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 650using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 696string source = FileUtilities.GetTemporaryFile(); 697string destination = FileUtilities.GetTemporaryFile(); 700using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 705using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 759string source = FileUtilities.GetTemporaryFile(); 760string destination = FileUtilities.GetTemporaryFile(); 767using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 772using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 825string source = FileUtilities.GetTemporaryFile(); 826string destination = FileUtilities.GetTemporaryFile(); 834using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 839using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 897string source = FileUtilities.GetTemporaryFile(); 898string destination = FileUtilities.GetTemporaryFile(); 901using (StreamWriter sw = FileUtilities.OpenWrite(source, true)) 906using (StreamWriter sw = FileUtilities.OpenWrite(destination, true)) 955string source1 = FileUtilities.GetTemporaryFile(); 956string source2 = FileUtilities.GetTemporaryFile(); 964using (StreamWriter sw = FileUtilities.OpenWrite(source1, true)) 969using (StreamWriter sw = FileUtilities.OpenWrite(source2, true)) 974using (StreamWriter sw = FileUtilities.OpenWrite(destination1, true)) 979using (StreamWriter sw = FileUtilities.OpenWrite(destination2, true)) 1026FileUtilities.DeleteWithoutTrailingBackslash(destinationFolder, true); 1040string sourceFile = FileUtilities.GetTemporaryFile(); 1041string destinationFile = FileUtilities.GetTemporaryFile(); 1044using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1049using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1071using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) // HIGHCHAR: Test reads ASCII (not ANSI). 1104var sourceFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.Path, null, "src", false); 1105var destinationFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.Path, null, "dst", false); 1172string sourceFile = FileUtilities.GetTemporaryFile(); 1173string destinationFile = FileUtilities.GetTemporaryFile(); 1177using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1182using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1222string sourceFile = FileUtilities.GetTemporaryFile(); 1263string destinationFile = FileUtilities.GetTemporaryFile(); 1267using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1310string destinationFile = FileUtilities.GetTemporaryFile(); 1314using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1363using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) // Keep it locked 1481string destinationFile = FileUtilities.GetTemporaryFile(); 1482string sourceFile = FileUtilities.GetTemporaryFile(); 1486using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 1528string sourceFile = FileUtilities.GetTemporaryFile(); 1532using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1848string sourceFile = FileUtilities.GetTemporaryFile(); 1854using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1881using (StreamReader sr = FileUtilities.OpenRead(destFile)) 1927using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 1953using (StreamReader sr = FileUtilities.OpenRead(destFile)) 1993using (StreamWriter sw = FileUtilities.OpenWrite(item.ItemSpec, false)) // HIGHCHAR: Test writes in UTF8 without preamble. 2051using (StreamWriter sw = FileUtilities.OpenWrite(item.ItemSpec, false)) // HIGHCHAR: Test writes in UTF8 without preamble. 2172string sourceFile = FileUtilities.GetTemporaryFile(); 2177using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 2217string destinationFile = FileUtilities.GetTemporaryFile(); 2456Assert.Contains(copyFunctor.FilesCopiedSuccessfully, f => f.Name == FileUtilities.FixFilePath("c:\\source")); 2457Assert.Contains(copyFunctor.FilesCopiedSuccessfully, f => f.Name == FileUtilities.FixFilePath("c:\\source2")); 2552string sourceFile = FileUtilities.GetTemporaryFile(); 2621string sourceFile1 = FileUtilities.GetTemporaryFile(); 2622string sourceFile2 = FileUtilities.GetTemporaryFile(); 2709FileUtilities.DeleteWithoutTrailingBackslash(destFolder, true); 2726string sourceFile = FileUtilities.GetTemporaryFile(); 2798FileUtilities.DeleteWithoutTrailingBackslash(destFolder, true); 2808string sourceFile = FileUtilities.GetTemporaryFile(); 2864FileUtilities.DeleteWithoutTrailingBackslash(destFolder, true); 2874string sourceFile = FileUtilities.GetTemporaryFile();
CreateCSharpManifestResourceName_Tests.cs (1)
329Assert.Equal(FileUtilities.FixFilePath(@"fr\RootNamespace.SubFolder.SplashScreen.bmp"), result);
Delete_Tests.cs (2)
48string source = FileUtilities.GetTemporaryFile(); 51using (StreamWriter sw = FileUtilities.OpenWrite(source, true))
Exec_Tests.cs (6)
350FileUtilities.DeleteWithoutTrailingBackslash(newTmp); 388FileUtilities.DeleteWithoutTrailingBackslash(newTmp); 400string newTmp = Path.Combine(FileUtilities.TempFileDirectory, directoryWithAmpersand); 425FileUtilities.DeleteWithoutTrailingBackslash(newTmp); 462FileUtilities.DeleteWithoutTrailingBackslash(newTmp); 605FileUtilities.DeleteWithoutTrailingBackslash(folder, true);
FileStateTests.cs (12)
62file = FileUtilities.GetTemporaryFile(); 81file = FileUtilities.GetTemporaryFile(); 108file = FileUtilities.GetTemporaryFile(); 127file = FileUtilities.GetTemporaryFile(); 146file = FileUtilities.GetTemporaryFile(); 165file = FileUtilities.GetTemporaryFile(); 184file = FileUtilities.GetTemporaryFile(); 210file = FileUtilities.GetTemporaryFile(); 236file = FileUtilities.GetTemporaryFile(); 262file = FileUtilities.GetTemporaryFile(); 290file = FileUtilities.GetTemporaryFile(); 315file = FileUtilities.GetTemporaryFile();
FindAppConfigFile_Tests.cs (2)
51Assert.Equal(FileUtilities.FixFilePath("foo\\app.config"), f.AppConfigFile.ItemSpec); 77Assert.Equal(FileUtilities.FixFilePath(@"foo\\app.config"), f.AppConfigFile.ItemSpec);
FindInList_Tests.cs (2)
120Assert.Equal(FileUtilities.FixFilePath(@"c:\foo\a.cs"), f.ItemFound.ItemSpec); 135Assert.Equal(FileUtilities.FixFilePath(@"foo\a.cs"), f.ItemFound.ItemSpec);
FindUnderPath_Tests.cs (2)
35Assert.Equal(FileUtilities.FixFilePath(@"C:\MyProject\File1.txt"), t.InPath[0].ItemSpec); 36Assert.Equal(FileUtilities.FixFilePath(@"C:\SomeoneElsesProject\File2.txt"), t.OutOfPath[0].ItemSpec);
GetInstalledSDKLocations_Tests.cs (6)
32if (FileUtilities.DirectoryExistsNoThrow(FakeSdkStructureRoot)) 34FileUtilities.DeleteDirectoryNoThrow(FakeSdkStructureRoot, true); 37if (FileUtilities.DirectoryExistsNoThrow(FakeSdkStructureRoot2)) 39FileUtilities.DeleteDirectoryNoThrow(FakeSdkStructureRoot2, true); 104FileUtilities.DeleteDirectoryNoThrow(tempPath, true); 141FileUtilities.DeleteDirectoryNoThrow(tempPath, true);
GetSDKReference_Tests.cs (41)
41if (FileUtilities.DirectoryExistsNoThrow(_fakeSDKStructureRoot)) 43FileUtilities.DeleteDirectoryNoThrow(_fakeSDKStructureRoot, true); 202if (FileUtilities.DirectoryExistsNoThrow(_cacheDirectory)) 205FileUtilities.DeleteDirectoryNoThrow(_cacheDirectory, true); 215if (FileUtilities.DirectoryExistsNoThrow(_cacheDirectory)) 218FileUtilities.DeleteDirectoryNoThrow(_cacheDirectory, true); 243t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true).ShouldBeTrue(); 353bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 379bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 405bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 430bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 505bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 516success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 527success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 554bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 606bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 613string cacheFile = sdkIdentity + ",Set=" + FileUtilities.GetHexHash(sdkIdentity) + "-" + FileUtilities.GetHexHash(sdkRoot) + ",Hash=*.dat"; 630bool success2 = t2.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 643string cacheFile2 = sdkIdentity2 + ",Set=" + FileUtilities.GetHexHash(sdkIdentity2) + "-" + FileUtilities.GetHexHash(sdkRoot2) + ",Hash=*.dat"; 649string[] allCacheFiles = Directory.GetFiles(_cacheDirectory, sdkIdentity2 + ",Set=" + FileUtilities.GetHexHash(sdkIdentity2) + "*"); 672bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 721bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 765bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 788bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 813bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 865bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 916bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 953bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1015bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1046bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1078bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1110bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1139bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1167bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1195bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1230bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1276bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1319bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true); 1365bool success = t.Execute(_getAssemblyName, _getAssemblyRuntimeVersion, p => FileUtilities.FileExistsNoThrow(p), synchronous: true);
HintPathResolver_Tests.cs (1)
73fileExists: p => FileUtilities.FileExistsNoThrow(p),
MakeDir_Tests.cs (5)
55FileUtilities.DeleteWithoutTrailingBackslash(dir); 113FileUtilities.DeleteWithoutTrailingBackslash(dir); 119FileUtilities.DeleteWithoutTrailingBackslash(dir2); 165FileUtilities.DeleteWithoutTrailingBackslash(dir); 222FileUtilities.DeleteWithoutTrailingBackslash(dir);
Move_Tests.cs (41)
24string sourceFile = FileUtilities.GetTemporaryFile(); 25string destinationFile = FileUtilities.GetTemporaryFile(); 29using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 69string sourceFile = FileUtilities.GetTemporaryFile(); 70string destinationFile = FileUtilities.GetTemporaryFile(); 74using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 122string sourceFile = FileUtilities.GetTemporaryFile(); 123string destinationFile = FileUtilities.GetTemporaryFile(); 128using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) 150using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) 170string sourceFile = FileUtilities.GetTemporaryFile(); 173using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 205string sourceFile = FileUtilities.GetTemporaryFile(); 206string destinationFile = FileUtilities.GetTemporaryFile(); 209using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 214using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) 235using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) 260string sourceFile = FileUtilities.GetTemporaryFile(); 261string destinationFile = FileUtilities.GetTemporaryFile(); 264using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 269using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) 287using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) 312string sourceFile = FileUtilities.GetTemporaryFile(); 313string destinationFile = FileUtilities.GetTemporaryFile(); 316using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 321using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) 343using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) 366string sourceFile = FileUtilities.GetTemporaryFile(); 367string destinationFile = FileUtilities.GetTemporaryFile(); 370using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 375using (StreamWriter sw = FileUtilities.OpenWrite(destinationFile, true)) 397using (StreamReader sr = FileUtilities.OpenRead(destinationFile)) 503file = FileUtilities.GetTemporaryFileName(); 507using (StreamWriter writer = FileUtilities.OpenWrite(file, false)) // lock it for write 680string sourceFile = FileUtilities.GetTemporaryFile(); 686using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) 707using (StreamReader sr = FileUtilities.OpenRead(destFile)) 723FileUtilities.DeleteWithoutTrailingBackslash(destFolder); 785string sourceFile = FileUtilities.GetTemporaryFile(); 790using (StreamWriter sw = FileUtilities.OpenWrite(sourceFile, true)) // HIGHCHAR: Test writes in UTF8 without preamble. 822string destinationFile = FileUtilities.GetTemporaryFile();
NativeMethodsShared_Tests.cs (3)
77string nonexistentFile = FileUtilities.GetTemporaryFileName(); 90string directory = FileUtilities.GetTemporaryDirectory(createDirectory: true); 103string file = FileUtilities.GetTemporaryFile();
OutputPathTests.cs (1)
185var expectedOutputPath = FileUtilities.CombinePaths(project.DirectoryPath, baseOutputPath, configuration).WithTrailingSlash();
ReadLinesFromFile_Tests.cs (5)
28var file = FileUtilities.GetTemporaryFileName(); 75var file = FileUtilities.GetTemporaryFileName(); 120var file = FileUtilities.GetTemporaryFileName(); 153var file = FileUtilities.GetTemporaryFileName(); 172var file = FileUtilities.GetTemporaryFileName();
ResolveCodeAnalysisRuleSet_Tests.cs (1)
46FileUtilities.DeleteWithoutTrailingBackslash(_path, recursive: true);
ResolveSDKReference_Tests.cs (91)
180FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 263FileUtilities.DeleteNoThrow(sdkManifestFile); 305FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 488FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 519FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 592FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 622FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 647FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 679FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 705FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 735FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 760FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 790FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 815FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 845FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 870FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 902FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 927FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 957FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 981FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1011FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1036FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1066FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1502FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1539FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1561FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1594FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1658FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1697FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1738FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1782FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1820FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1880FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1915FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1953FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 1986FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2022FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2051FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2088FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2124FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2163FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2193FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2231FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2263FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2301FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2334FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2373FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2406FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2442FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2476FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2516FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2550FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2581FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2615FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2648FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2682FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2712FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2747FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2780FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2828FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2878FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2926FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 2976FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3032FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3089FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3137FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3187FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3230FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3269FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3304FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3346FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3380FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3412FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3448FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3490FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3524FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3554FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3587FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3626FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3661FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3690FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3771FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3840FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3912FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 3983FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4034FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4093FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4138FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4190FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4277FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true); 4322FileUtilities.DeleteDirectoryNoThrow(testDirectoryRoot, true);
ResourceHandling\GenerateResource_Tests.cs (10)
960additionalInputs = new ITaskItem[] { new TaskItem(FileUtilities.GetTemporaryFile()), new TaskItem(FileUtilities.GetTemporaryFile()) }; 1410strFile = FileUtilities.GetTemporaryFile(); 1624FileUtilities.DeleteNoThrow(bitmap); 1625FileUtilities.DeleteNoThrow(resxFile); 1627FileUtilities.DeleteNoThrow(t.StronglyTypedFileName); 1630FileUtilities.DeleteNoThrow(item.ItemSpec); 2617t.StateFile = new TaskItem(FileUtilities.GetTemporaryFile()); 3024FileUtilities.DeleteWithoutTrailingBackslash(dir); 4186string f = FileUtilities.GetTemporaryFileName();
TestAssemblyInfo.cs (1)
76FileUtilities.ClearTempFileDirectory();
WriteCodeFragment_Tests.cs (1)
188FileUtilities.DeleteWithoutTrailingBackslash(folder, true);
WriteLinesToFile_Tests.cs (5)
52var file = FileUtilities.GetTemporaryFile(); 102var file = FileUtilities.GetTemporaryFile(); 185var file = FileUtilities.GetTemporaryFile(); 252var fileExists = FileUtilities.GetTemporaryFile(); 253var fileNotExists = FileUtilities.GetTemporaryFileName();
XslTransformation_Tests.cs (1)
1151FileUtilities.DeleteWithoutTrailingBackslash(dir, true);