I spend a lot of time on the Express Edition Forums, and there are a few questions I see often enough that they probably deserve some more in depth answers here. One of these is the category of questions about Build Configurations in the Express Editions (C# Express in particular). Specifically, many folks on the Forums have asked questions along the lines of:
- “Why can’t I change build configurations in Express?”
- “How do I build Release in Express?”
- “Can I create new build configurations in Express?”
The quickest answer to these questions is to go to Tools->Options->Projects and Solutions->General and check “Show advanced build configurations”. Doing this will bring back the configuration chooser combo-boxes and dialogs that VS2003 developers are likely familiar with.
So why is this option off in Express? Well, you can start by considering how you typically use build configurations in your personal development cycle. If you are like most developers (especially hobbyist developers) we watch, you don’t change build configurations very often (if ever!). When you do change build configuration, it’s probably right before you want to release a version of your app out to the community or to a friend.
Since this pattern is fairly predictable and common, we thought we could take some of the complexity out of the product in this area by controlling your build configuration automatically. We call this Simplified Build Configurations. Here’s what we do behind the scenes:
- When you F5 we build Debug and then run in the debugger
- When you Build (ctrl-shift-b) we build Release
This lets us do the “right thing” for you based on the task you are doing (F5 vs. Build). Of course, this affects a few other areas of the product as well. For instance, Project Properties don’t allow you to choose which build configuration they apply to. Instead, the setting you provide is applied to either both or just Release depending on the setting. Typically this just accomplishes the “right thing” and allows you to not worry about configurations at all. But there are a couple “gotchas” if you expect the same behaviour you had in VS2003.
- On the Build page, conditional compilation symbols will apply to both configurations; but the checkboxes for individual symbols will apply only to Release.
- Settings like “Output Path” use the Release configuration.
The overriding motivation behind this is the same one that motivates the Express Editions in the first place: We want to create a small, lightweight, approachable and easy to learn developer tool for beginners, hobbyists and students. By removing some of the complexity around build configurations we hope to have pushed the product in this direction. For those of you who are comfortable with the complexity of build configurations and who have a need to manually manage configurations, feel free to flip the tools|options setting to go back to the VS2003-like behaviour.