You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raise this issue as a result of a gitter discussion.
My scenario: I have a couple of .config files checked in the source control (TFS VC), which needs to be replaced (or re-generated) before I invoke MSBuild.
I use "DeleteFiles" and/or "CleanDirectories" for this kind of stuff from Cake, but both will fail because they refuse to delete "read-only" protected files.
Gary told me that this behavior is by design and is in most cases the logical choice. He pointed me to the FileHelper addin - maybe this would be a good place for this kind of functionality.
My current workaround is trivial:
public void EnsureFileIsWritable(string filePath)
{
System.IO.File.SetAttributes(filePath, FileAttributes.Normal);
}
If you are interested in a PR just let me know.
The text was updated successfully, but these errors were encountered:
I raise this issue as a result of a gitter discussion.
My scenario: I have a couple of .config files checked in the source control (TFS VC), which needs to be replaced (or re-generated) before I invoke MSBuild.
I use "DeleteFiles" and/or "CleanDirectories" for this kind of stuff from Cake, but both will fail because they refuse to delete "read-only" protected files.
Gary told me that this behavior is by design and is in most cases the logical choice. He pointed me to the FileHelper addin - maybe this would be a good place for this kind of functionality.
My current workaround is trivial:
If you are interested in a PR just let me know.
The text was updated successfully, but these errors were encountered: