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
精彩评论