How to copy file with Target Copy on file change

98 Views Asked by At
  <Target Name="BeforeCompile">
    <Copy SourceFiles="..\Foo.js" DestinationFolder="Foo.Files\Js" SkipUnchangedFiles="True" OverwriteReadOnlyFiles="True" />
  </Target>

This code running before build. But i want to do this when the file changes in debug. It's posible?

2

There are 2 best solutions below

0
Martin Ullrich On BEST ANSWER

MSBuild only runs to build your project. While the executable is running, MSBuild is no longer working on your project.

This means that there is no possibility to do this (watch sources) in MSBuild.

0
Sevket Yilmaz On

I did using the Grunt(grunt-contrib-copy).

Grunt Config Grunt Config2

Thanks everyone...