Thursday 26 March 2015

Projects have recently been added to this solution. Really?

One of the most dreaded things that one may be asked to do is to merge code base present in two different branches. Even though there are many amazing version control systems are available at our disposal e.g. Team Foundation Server, Git etc., merging conflicts during the merge becomes a true pain point. Add to that the misery of the fact that it might just break the build or say add unintended lines to the code base. 

Recently I took up the responsibility of merging two branches (because others did not want to do it, you know), I ran into an interesting merge case. If your code base is built using Visual Studio, there can be large solution files (.sln) which have cryptic GUID values that map to different sections and carry different settings. After merging code during last week, the target branch code started to show me strange popup "Projects have recently been added to this solution. Do you want to get them from source control?".


This was strange because there was no new project added to the source branch or target branch since the last merge. So i looked at the solution file (.sln) that was created after the merge. After going through it for some time, i figured out the culprit - solution file was somehow injected with multiple "GlobalSection(TeamFoundationVersionControl) = preSolution" sections during the merge. This caused the visual studio to expect more projects and thus the prompt.

Once i removed the spurious entries, it was normal again :)

No comments:

Post a Comment