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

  • Home
  • SEARCH
  • 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 320237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:44:06+00:00 2026-05-12T08:44:06+00:00

I’m building a DLL class library – I want to make it usable by

  • 0

I’m building a DLL class library – I want to make it usable by as many people as possible. Which version of the .NET Framework and which C# version should I use? Is it possible to produce a backwards-compatible DLL or different DLLs for different versions? Or does Windows automatically update the .NET framework so I should just use the latest version? Any guidance appreciated!

  • 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-12T08:44:06+00:00Added an answer on May 12, 2026 at 8:44 am

    We target multiple runtime versions concurrently (.NET 1.1, .NET 2.0, and .NET 3.5) for some products.

    We handle this in several ways:

    • Separate Solution and Project files and for each of .NET 1.1, 2.0, and 3.5 SP1, but referencing the same source files.

    eg:

     \ProductFoo_1_1.sln (.NET 1.1 solution, VS 2003)
     \ProductFoo_2_0.sln (.NET 2.0 solution, VS 2008)
     \ProductFoo_3_5.sln (.NET 3.5 solution, VS 2008)
    
     \FooLibrary\FooLibrary_1_1.csproj (.NET 1.1 Project, VS 2003) 
     \FooLibrary\FooLibrary_2_0.csproj (.NET 2.0 Project, VS 2008) 
     \FooLibrary\FooLibrary_3_5.csproj (.NET 3.5 Project, VS 2008) 
    
     \FooLibrary\FooClass.cs (shared amongst all Projects)
     \FooLibrary\FooHelpers_1_1.cs (only referenced by the .NET 1.1 project)
    
     \FooService\FooService_3.5.csproj (.NET 3.5 Project, VS 2008)
     \FooService\FooService.cs
    
    • Defining NET_X_X symbols in each of the solutions

    • For .NET Framework specific code, we use preprocessor instructions such as this:

    public void SomeMethod(int param)
    {
    #ifdef NET_1_1
     // Need to use Helper to Get Foo under .NET 1.1
      Foo foo = Helper.GetFooByParam(param);
    #elseif NET_2_0 || NET_3_5
     // .NET 2.0 and above can use preferred  method. 
      var foo =  new Foo { Prop = param }; 
      foo.LoadByParam();  
    #endif 
      foo.Bar();
    }
    
    #ifdef NET_3_5
    // A method that is only available under .NET 3.5 
    public int[] GetWithFilter(Func Filter)
    { 
      // some code here
    }
    #endif 
    

    For clarification, the above lines starting with # are preprocessor commands. When you compile a solution, the C# Compiler (csc) pre-processes the source files.
    If you have an #ifdef statement, then csc will evaluate to determine if that symbol is defined – and if so, include the lines within that segment when compiling the project.

    It’s a way to mark up code to compile in certain conditions – we also use it to include more intensive debugging information in specific verbose debug builds, like so:

    #if DEBUG_VERBOSE
      Logging.Log("Web service Called with parameters: param = " + param);
      Logging.Log("Web service Response: " + response); 
      Logging.Log("Current Cache Size (bytes): " + cache.TotalBytes); 
      // etc. 
    #endif 
    
    • We then have NAnt scripts which automate the production of a release for each .NET version.
      We happen to control all this through TeamCity, but we can trigger the NAnt scripts manually too.

    It does make things more complicated, so we only tend to do it where we need to maintain a legacy .NET 1.1 or 2.0 instance (eg where a customer can’t/won’t upgrade).

    I imagine that when .NET 4.0 rolls around, we’ll do the same thing and just add a NET_4_0 symbol.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.