views:

148

answers:

1

We seem to have an annoying issue with Visual Studio, we have a pretty big solution consisting of lots of projects, and over 20 solution configurations.

Whenever we add a new project to the solution, it comes off as 'buildable' in all of the pre-existing solution configurations. It then becomes tedious to go through all of them and uncheck the "Build in this configuration?" checkbox - and people often forget, consequently breaking builds.

Is there any way to maybe have it default to unchecked when you add a new project in Visual Studio? Or does anyone know of some sort of add-in that can do this?

+2  A: 

I don't know the answer to your precise question, but I do know that you can fire macros when projects are added or removed from a solution.

My memory is hazy, but in the Macros IDE, there should be a EnvironmentEvents module, in which you can hook code up to the SolutionEvents_ProjectAdded and SolutionEvents_ProjectRemoved events.

From there, you can have a look in DTE.Solution.SolutionBuild.SolutionConfigurations, I guess.

You may have some problems if the event is fired BEFORE the project has been added to the configurations.

(I use these events to toggle between file and project references when adding/removing projects)

Benjol
Thanks, I'll look into it.
legenden