Ok, So I figured it out. Turns out, it wasn't working locally either. Its just in VS 2010 IDE i did not run clean build every time, so it was picking up already transformed file.
To troubleshoot it I ended up running MSBuild command-line, and when I did that I noticed that the last target run was ScReplaceAppConfigItem
. I tried to use AfterTargets
to force my tasks to run after but it did not help. My tasks still run before.
What made it work, was actually using older DependsOnTargets
attribute:
<Target Name="AfterBuild" DependsOnTargets="ScReplaceAppConfigItem">
<Exec Command="Echo $(OutputPath)" />
<Exec Command="Type $(OutputPath)Migrations.exe.config" />
<Exec Command="$(OutputPath)Migrations.exe" />
</Target>