In Visual Studio, I have custom MSBuild actions for different levels - development, production, testing, etc. These scripts will automatically compile everything, replace web.config, and output the code to a location based on the selected configuration. Usually, when I want to run one of these builds on something other than development, I call the build script from the command line.
Although I try to be as diligent as possible, sometimes I (and others working in the solution) accidentally leave the configuration in what they did not want - maybe they switched it to the “intermediate” configuration to see how the code looks from its specific preprocessor directives. Then they press "F5", thinking that they are in development to debug ... and accidentally supersede the busted code.
So the question is, is there a way to have build scripts related to the configuration, but prevent builds for specific configurations from the IDE? Or display a warning? Or am I starting this wrong?
Chris source
share