Great solution, many solution configurations, adding a new project

We seem to have an annoying problem with Visual Studio, we have a rather large solution consisting of many projects and more than 20 solution configurations.

Whenever we add a new project to a solution, it is displayed as “embedded” in all existing solution configurations. Then it becomes tedious to go through all of them and uncheck "Build in this configuration?". checkbox - and people often forget, therefore, break assemblies.

Is there a way to disable it by default when adding a new project in Visual Studio? Or does anyone know some kind of add-in that can do this?

+3
source share
1 answer

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)

+2
source

Source: https://habr.com/ru/post/1715617/


All Articles