This project is read-only.

MSBuild.ExtensionPack.FileSystem.File Task Replace adds some bytes to the begin of the file

Oct 9, 2013 at 1:59 PM
Edited Oct 9, 2013 at 2:02 PM
Greetings all,

I experienced some problem when using MSBuild.ExtensionPack.FileSystem.File target with action "Replace". It replaces all that I need, but adds some bytes to the beginning of the file. These bytes are visible only in binary view, but they doesn't allow to run that file - it fails with exception "'set' is not recognized as an internal or external command". Before replacement file was beginning with command "set".

These bytes are added even if I simply replace one word with another, e.g.:
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="Config" Replacement="ConfigNew" Files="@(CreateTenants)"/>
Can anybody explain me, how I can handle this?
Oct 9, 2013 at 2:15 PM
Marked as answer by rmykh on 10/9/2013 at 6:48 AM
Oct 9, 2013 at 2:47 PM
Thanks a lot, TextEncoding="windows-1251" fixed this issue.