I do not know the answer to your exact question, but I know that you can run macros when projects are added or removed from the solution.
My memory is foggy, but there should be an EnvironmentEvents module in the Macros IDE in which you can bind code to the SolutionEvents_ProjectAdded and SolutionEvents_ProjectRemoved events.
From there you can look at DTE.Solution.SolutionBuild.SolutionConfigurations, I think.
You may have problems if the event is fired before the project has been added to the configuration.
(I use these events to switch between file and project links when adding / removing projects)
source
share