开发者

how to automated a BUILD task

I need help about how to automated a task with MSBUILD.

I wrote a small command line program that process files and I want integrate it at the moment of BU开发者_如何学JAVAILD the solution.

The program itself is used like this:

Processor.exe inputFile.txt outputFile.txt –p

-p of course represents some parameters.

Is there a simple way to make visual studio to run this exe AFTER each Buildup??

To be honest I research a lot about the MSBUILD, but there is so much information out there, that it overwhelmed me.


There are different solutions but in your case the best is probably with custom AfterBuild target and Exec task. You should add it to your cproj file after Microsoft.CSharp.targets get imported.

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name ="AfterBuild">
  <Exec Command="Processor.exe inputFile.txt outputFile.txt –p"  />
</Target>

You can read more about Exec Task here:

Exec Task

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜