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 552387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:29:40+00:00 2026-05-13T11:29:40+00:00

I would like to be able to use .NET 3.5 types in an application

  • 0

I would like to be able to use .NET 3.5 types in an application based on .NET 2.0.
Basically we don’t have deployed .NET 3.5 libraries in desktops but we need to use some classes from there. Any ideas how this is possible ?

Thanks,
Marios

  • 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-13T11:29:40+00:00Added an answer on May 13, 2026 at 11:29 am

    This question got me wondering, so I dug into it a bit.

    The answer to your question depends on how many dependencies you have on the new frameworks, and how much hacking you are willing to do.

    The real best answer is to bite the bullet and install the necessary framework. However, if you need to just distribute a single assembly from .net 3.0 it may be possible. I’m pretty sure, requiring an assembly from 3.5 will require installing 3.0. At that point, you have nothing to gain by not installing 3.5.

    Here’s the hacking I did to make an assembly from 3.0 work from 2.0:

    Hack # 1
    Add the reference to the required 3.0. Visual Studio should complain. Unload the project and edit the project file. Remove this line from the xml and reload the project.

    <RequiredTargetFramework>3.0</RequiredTargetFramework>
    

    Visual Studio will happily compile and run with this assembly now.

    Hack # 2
    Change the copy local property in the assembly references list to true.

    Hack # 3 (Ugliest hack)
    Modify the machine config to add the config section for the required assembly. This may or may not be required, depending on the assembly you are pulling in. In my test, I referenced the System.Runtime.Serialization assembly and needed to copy this section from the machine.config on my 3.5 machine to my 2.0 machine.

    <sectionGroup name="system.runtime.serialization" type="System.Runtime.Serialization.Configuration.SerializationSectionGroup, System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <section name="dataContractSerializer" type="System.Runtime.Serialization.Configuration.DataContractSerializerSection, System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    

    Once I did that, the following code ran just fine on my .net 2.0 box.

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                Console.WriteLine("Testing serialization");
    
                DataContractSerializer formatter = new DataContractSerializer(typeof(Junk));
                MemoryStream stream = new MemoryStream();
    
                Junk junk = new Junk();
                junk.Name = "Junk";
                junk.Value = 15;
    
                formatter.WriteObject(stream, junk);
                Console.WriteLine("Wrote object to stream");
    
                stream.Seek(0, SeekOrigin.Begin);
    
                Junk savedJunk = formatter.ReadObject(stream) as Junk;
    
                Console.WriteLine("Deserialized name = {0}", savedJunk.Name);
                Console.WriteLine("Deserialized value = {0}", savedJunk.Value);
    
                Console.WriteLine("Testing complete");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
    }
    
    [DataContract]
    class Junk
    {
        [DataMember]
        public string Name = "";
        [DataMember]
        public int Value = 0;
    }
    

    …again, I’m not recommending this. But, it may be possible to bend the rules if you are really desperate.

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

Sidebar

Related Questions

I would like to be able to use the Tab key within a text
I'm writing a component that I would like to be able to use in
I would like to be able to define and use a custom type in
I would like to be able to loop through all of the defined parameters
We would like to be able to nightly make a copy/backup/snapshot of a production
I would like to be able to display some dynamic text at the mouse
I would like to be able to obtain all the parameter values from the
I would like to be able to predict what will be in the resulting
I would like to be able to do such things as var m1 =
I would like to be able to embed a command line interpreter inside a

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.