.png)
Welcome to the 2nd post for the Managing LunchMaster with BuildMaster series. This series of blog posts is intended to build a real-world application using BuildMaster from the start to manage its builds, releases, deployments, databases, and artifacts. This series will focus on management from within BuildMaster, so focus on LunchMaster itself will be secondary.
If you do not yet have a copy of BuildMaster and would like to follow along, simply click here to download a free trial!
Configuration Files
A configuration file is a special type of file that is part of an application. Unlike code files (which remain identical in every environment), configuration files are read by other code files at run time and contain environment-specific details. Configuration files generally contain some form of the following:
- connection strings
- web service URLs
- application-specific key/value pairs
- debugging/logging options
For LunchMaster, we will start by adding the Visual Studio auto-generated Web.config. To create this file in BuildMaster, select Configuration Files from the sidebar navigation menu, and Create New Configuration File. We will associate this configuration file with the Website deployable. We will also be required to select which Environments that this configuration file will exist in or eventually be deployed to (generally it will be all of them since it is rare that configuration files will not be deployed to a certain Environment).

When created in BuildMaster, the configuration file instances will be blank and must be populated from an existing file in the file system or source control, or they can be created directly within BuildMaster. To modify an instance, select Edit Configuration File from the configuration file details page, and you will see a pop-up with the Environment/instance names in the tabs above the textbox:

If we choose Load From… in the top menu of the pop-up window, we will be given the option to either:
- upload a file directly from my workstation
- load the file from an existing server registered within BuildMaster
- load directly from a source control provider
In my case, I will upload the file directly from my workstation making sure to select both instances because this is a new application. If LunchMaster were an existing application and I already had two instances of the same configuration file (one for the development environment and one for production), I would have uploaded both of them and selected the appropriate Environment with which to associate each instance.
Once uploaded, both instances will now be populated with the contents of the Web.config file:

If we select the Production tab, we will see a different instance of the configuration file. To change this instance, we will change the debug="true" attribute from the <compilation> section to debug="false". For the non-ASP.NET folks, this attribute is intended to be set to true for development/testing environments and false for production environments.

We are now ready to save this file within BuildMaster by selecting Confirm & Save Changes. Now the configuration file details page will display both instances:

Next, we will edit our previous deployment plan for the development environment to include deploying the configuration file. We will select Development in the sidebar navigation menu and choose the Transfer Files Action Group, Add New Action, then under Configuration, Deploy Config Files:

We will use the following values for the Deploy Config Files Action and choose Save:

Now whenever we create a new Build to my development environment, the development instance of the configuration file will be deployed to the \LunchMasterDev directory. We can test this out by selecting Create New Build in the sidebar navigation menu, and the subsequent button on the Create Build page. The results of the build are displayed on the Build Details page:

That's all for part 2! Next up in the series, integrating with a source control management system (or more specifically, Subversion).