I have a VS2010 solution with four projects in it.
I have a semi-complex command line that I want to run which uses Visual Studio build event macros.
This command line is currently in the post-build
event of each project - however the command line is identical in each project, and I'd like to try to keep things DRY.
Is there a way to eliminate the repetition here, somehow setting up my command line, with macros, as a task somewhere and just call that task for each project?
I dont know if exists any way to link
post-build
events of different projects, but if you want to get the same effect you have to focus on having at all the.csproj
files the same<PropertyGroup>
tag, like this:So, you can build a small application that inserts at every
.csproj
file those tags with the desired command.Hope helps!
EDIT:
Another (hardly) possibility its to develop your own task inheriting from
Task
, codig theExecute()
method as you wish an then, linking the.dll
file at the.csproj