Search code examples
vb.netvisual-studio-2010macrosvisual-studio-macros

Visual Studio macro/anything else to iterate through all projects and set project properties


I'm trying to write a macro/anything else to iterate though all projects and remove all other build configuration other that Active Solution Configuration - Debug and Active Solution Platform - x86. Also after editing the configuration for all projects, I want to set pre-build and post-build events to all projects. I have no clue where to start. Please help. I have like 44 projects in solution and its really hard and time consuming to set all these manually.

Pre Build event:

rd /s /q "$(ProjectDir)bin"

Post Build event:

copy "$(TargetPath)" "$(SolutionDir)TOTALOUTPUT\" /y

Solution

  • I could not understand your point clearly but let me try to help...

    You can create a new configuration by clickint Build->Configuration Manager->New (top left, there is active solution configuration, click on it you will see New option) Name it and check the projects you wanna compile

    Then simply go your solution, select the projects with Ctrl and then leftclick->properties VS allows you to change the properties of multiple projects, so you can easily writes post builds and pre builds events like that, it will work for all projects you selected...