Reputation: 309
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 BUILD 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.
Upvotes: 1
Views: 402
Reputation: 2591
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:
Upvotes: 3