We have a solution with several projects in it, and need to run a tool on our compiled code after all of our code is compiled. The tool must take, as input, all .dll and .exe files built from the solution (so for an incremental build, it is not enough to give it only the just-rebuilt binaries), and all of those binaries must be up to date.
Right now we do this with an MSBuild .proj file that we run from the a command line, which includes all projects and uses the Output element of MSBuild to find the paths to the binaries in the solution.
This has two problems that make this solution not quite fit what we need. The tool does not need to actually be run on all projects, only some of them. And it's required that we be able to build from within Visual Studio.
It seems like what I need is, in some projects' .csproj files, to define something that says "run the tool on me", to collect those project's paths, and to run the tool on that collection of paths.
But I can't see how to do this. It looks like when I build from Visual Studio, I cannot share state between project builds, and it looks like there is no hook for after the solution builds.
From the command line, there are before.*.sln.targets and after.*.sln.targets, but these do not work from Visual Studio.
It seems like what I want is ridiculously simple, I just want a tool to automatically look at the solution's binaries after a build, so I do not think this should be impossible. But I can't see how to do this from the documentation. I am new to MSBuild, so I am probably missing something obvious.