Allegient, my new employer, uses GitLab for source control on the project I am currently engaged on. I’ve primarily been using TFS at my previous position.
Working with a specific branch in Visual Studio 2013 isn’t as intuitive as I expected. Here are the steps I followed to get a specific branch from GitLab (or any Git-based server).
In Visual Studio, open up the Team Explorer tab, and select the Connect icon. Enter the URL of the Git project into the textbox. Select Clone.
The project will pull down into the designated folder. You will notice that the branch you want to work with is missing!
Double click the project that is now listed, which will open up the Home screen for that project. From there click on the Branch dropdown and select New Branch.
The branches for the project are listed in the dropdown. Select the desired branch and click “Create Branch”. As counter-intuitive as this sounds, it simply pulls down the branch to your machine. After it is created you will be able to open the .sln and start developing!
.Net projects can include settings that allow the runtime of an application to be altered based on values present in the Web.config file for the application. Modifying these values doesn’t require the application to be re-compiled when they are changed, which is advantageous in production systems where settings need to be altered without disrupting the environment.
Moving a project from TFS 2008 to TFS 2013 caused some issues with syncing the Web.config with the Settings.settings file. Changes made to the Web.config and then saved usually persist back to the settings file automagically. With a deployed application modifying the Web.config settings was not affecting the application. When the project was deployed the Settings.settings file had a value that wasn’t the same as the Web.config. Strangely, after deploying the application the application ignored changes made to the Web.config.
After a few minutes of head scratching I peeked into the Settings.Designer.cs file and found the setting was not updating when changed in the Web.config. I manually changed the string returned by the setting and saved the file. Like magic, the Web.config started updating the Settings.setting.
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("test")]
public string Setting {
get {
return ((string)(this["Setting"]));
}
}