In Visual Studio, I have custom MSBuild actions for various tiers - development, staging, testing, and so on. These scripts will automatically compile everything, do web.config swapping, and push code out to a location based on the chosen 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.
Though I try to be as diligent as possible, sometimes myself (and others working in the solution) will accidentally leave the configuration in one they didn't mean to - maybe they switched it to the "staging" configuration to view how the code looks with its specific preprocessor directives. Then they hit "F5" thinking they're in development to debug...and push busted code out accidentally.
So the question is, is there a way to still have the build scripts tied to the configuration, but disallow builds for certain configs from the IDE? Or pop up a warning? Or am I going about this the wrong way to begin with?