Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 914081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:39:44+00:00 2026-05-15T17:39:44+00:00

What are common practices for designing a build system/project structure that allows targeting multiple

  • 0

What are common practices for designing a build system/project structure that allows targeting multiple .NET versions with different feature sets?

Specifically:

  • Should you branch in source control?
  • Should you use conditional compilation?
  • Should you derive interfaces, thereby versioning them?
  • Should you create seperate “versionX” projects and link common project files?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:39:45+00:00Added an answer on May 15, 2026 at 5:39 pm

    I’ve tried a few different ways of doing this.

    I ruled out branching because it’s a bit difficult to keep all the branches in sync using SVN/TFS. Distributed SCC does have more advanced support for branching/merging, so I’m planning to reconsider this approach if I ever convert.

    I use conditional compilation along with version-specific projects using linked source files. The most aggressive library I’ve done along these lines is Nito.Linq, which hasn’t been released yet. You can check out the source, though, to see how I’ve set up the projects. It currently targets 3.5, 4.0, SL3, and SL4, and has “with Rx” and “without Rx” variants for each of these. I had CF 3.5 working as well, but VS2010 doesn’t support it.

    There are a few drawbacks to this approach:

    • In my solution, I defined a “Sources” project that acts as a container for the files. Unfortunately, it’s built when loaded and I can’t add source files when it’s unloaded; so it ends up getting in the way.
    • Linking the source files in projects targeting different frameworks causes another problem: it’s not possible to open the same source file in different projects. VS will inform you of the fact and then show the already-open source file from another project. This affects IntelliSense, especially with the conditional compilation. Not a show-stopper, but many times you’ll open a file and then have to close it and re-open it (and then go back to the position where you were).
    • Unit tests on VS2010 have to target the 4.0 framework. So any testing on other framework versions has to be done in a non-VS2010 way. I haven’t found a good solution for this yet; it doesn’t affect Nito.Linq because unit testing the 4.0 variants tests all the code.

    I did ask the Rx team how they handled this situation (they support 3.5, 4.0, SL3, and SL4 with the same codebase). Apparently, they use a custom in-house tool to create metadata-only versions of the runtime assemblies and then combine these into a superset-profile containing the merged metadata-only assemblies. The project is built against this superset-profile and a post-compilation “retargeting” is done to change the project’s profile to one of the normal profiles.

    I briefly played around with building an open-source equivalent of the Rx team’s tool, but ran into too many “underdocumented” snags. It should be possible in theory, but I figured it would take way too much time for anyone without the correct contacts inside Microsoft.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 445k
  • Answers 445k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is more than one way to do this. Depending… May 15, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer The only way at the moment that I can think… May 15, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer You can use SMO for this. Example here http://www.sqldbatips.com/showarticle.asp?ID=45 Or… May 15, 2026 at 7:01 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.