2

I had the same question as was asked in this thread, i.e. I was looking for a way to run an executable or script after building a solution in Visual Studio.

I tried out the suggested solution of catching the OnBuildDone event with a macro, which (as I understand it) needs to be placed in the EnvironmentEvents section under MyMacros in the Macros IDE. The problem with this is that it makes the macro global to everything I do in Visual Studio. In other words, it runs the macro regardless of which solution it is that I am building. However, I only want it to run for that one solution.

Is there a way to make a macro that catches the OnBuildDone event for a specific solution only?

Community
  • 1
  • 1
Brandon
  • 1,747
  • 17
  • 15

1 Answers1

3

One way to do it is:

  • Define a new, faily empty, project within that solution
  • Specify that this new project depends on every other project (so that this new project will be built after all other projects)
  • Invoke your executable or script as a build event of this new project (instead of, of the solution)
ChrisW
  • 54,973
  • 13
  • 116
  • 224