19 writes to File
Microsoft.Build.Tasks.UnitTests (19)
ReadLinesFromFile_Tests.cs (4)
34
File
= new TaskItem(file),
81
File
= new TaskItem(file),
126
File
= new TaskItem(file),
178
File
= new TaskItem(file),
WriteLinesToFile_Tests.cs (15)
37
File
= new TaskItem("c:\\" + Guid.NewGuid().ToString()),
59
File
= new TaskItem(file),
78
File
= new TaskItem(file),
110
File
= new TaskItem(file),
131
File
= new TaskItem(file),
143
File
= new TaskItem(file),
169
File
= new TaskItem(file),
193
File
= new TaskItem(file),
214
File
= new TaskItem(file),
227
File
= new TaskItem(file),
272
File
= new TaskItem(fileExists),
283
File
= new TaskItem(fileNotExists),
306
File
= new TaskItem(file),
337
File
= new TaskItem(file.Path),
363
File
= new TaskItem(file.Path),
15 references to File
Microsoft.Build.Tasks.Core (14)
FileIO\WriteLinesToFile.cs (14)
70
if (
File
!= null)
99
var directoryPath = Path.GetDirectoryName(FileUtilities.NormalizePath(
File
.ItemSpec));
111
if (FileUtilities.FileExistsNoThrow(
File
.ItemSpec))
113
string existingContents = System.IO.File.ReadAllText(
File
.ItemSpec);
118
Log.LogMessageFromResources(MessageImportance.Low, "WriteLinesToFile.SkippingUnchangedFile",
File
.ItemSpec);
119
MSBuildEventSource.Log.WriteLinesToFileUpToDateStop(
File
.ItemSpec, true);
124
Log.LogErrorWithCodeFromResources("WriteLinesToFile.ErrorReadingFile",
File
.ItemSpec);
132
Log.LogMessageFromResources(MessageImportance.Low, "WriteLinesToFile.ErrorReadingFile",
File
.ItemSpec);
134
MSBuildEventSource.Log.WriteLinesToFileUpToDateStop(
File
.ItemSpec, false);
137
System.IO.File.WriteAllText(
File
.ItemSpec, contentsAsString, encoding);
143
Log.LogMessageFromResources(MessageImportance.Normal, "WriteLinesToFile.UnusedWriteOnlyWhenDifferent",
File
.ItemSpec);
147
System.IO.File.AppendAllText(
File
.ItemSpec, buffer.ToString(), encoding);
152
string lockedFileMessage = LockCheck.GetLockedFileMessage(
File
.ItemSpec);
153
Log.LogErrorWithCodeFromResources("WriteLinesToFile.ErrorOrWarning",
File
.ItemSpec, e.Message, lockedFileMessage);
Microsoft.Build.Tasks.UnitTests (1)
WriteLinesToFile_Tests.cs (1)
43
Assert.False(File.Exists(a.
File
.ItemSpec));