Search code examples
.netbuild-process

Conditional compilation vs. branching the code


We have a project that needs to be build for both .NET 1.1 and 2.0 due to server compatibility issues (Windows Server 2000 and Windows Server 2003 production servers).

I am looking for help making the decision between conditional compilation or branching the code in source control. There are pros and cons for each.


Solution

  • One thing that would impact my solution is knowing how long I expected the 1.1 solution to survive and what its purpose was. If the solution was in maintenance mode and really wasn't going to be adding too many new features, I would pick a separate branch solution. I would then carefully migrate needed changes between the two branches.

    If however it is a full-fledged version that will have most, if not all, of the same features, I would go the conditional compilation route. Otherwise, every single check in you make would also have to be merged into another branch before it was complete.