none
framework 3.5 and 4.0 at the same time RRS feed

  • Question

  • Hello, i have a program I REALLY NEED which runs on framework 3.5 and I need v4.0 for visual studio 2010 (C#), is there somehow i can select between what framework versions I want a program to run? (I mean select the program to run with 3.5 and visual studio with 4.0?) tnx

     

    P.S. I'm using windows 7 Ultimate.

    • Edited by NeOFrEaK Thursday, September 8, 2011 6:02 AM
    • Moved by Tim Lovell-Smith Thursday, September 8, 2011 6:48 AM A general .net question related to setup/forwards compat (From:.NET 4: Windows Workflow Foundation)
    Thursday, September 8, 2011 6:01 AM

Answers

  • Neo,

    Yes, that's very easy.  Just right click on your project and select Properties, and then on the Properties page select the Application tab.

    It will have a selection for which framework you want the program to target.  


    Tom Overton
    • Marked as answer by NeOFrEaK Thursday, September 8, 2011 6:14 AM
    • Edited by Tom_Overton Thursday, September 8, 2011 6:15 AM
    Thursday, September 8, 2011 6:13 AM
  • Yeah you don't want to uninstall 4.0 or that will break VS 2010.  You would have been okay having .NET framework 4.0 on there because it is backwards compatible to 3.5.  Versions 3.5, 3.0, and 2.0 all run in the CLR 2.0 and framework 4.0 runs under CLR 4.0 but 4.0 can fully handle any application that uses 3.5.

    For an overview of how the frameworks work, see this documentation:

    http://msdn.microsoft.com/en-us/library/bb822049.aspx

    Try to re-install 4.0 if you can.  IF Visual studio is still broken, then you may need to start fresh and uninstall visual studio and then install it again (which will also install 4.0 framework for you of course).


    Tom Overton
    • Edited by Tom_Overton Thursday, September 8, 2011 6:28 AM
    • Marked as answer by NeOFrEaK Thursday, September 8, 2011 6:39 AM
    Thursday, September 8, 2011 6:27 AM

All replies

  • Neo,

    Yes, that's very easy.  Just right click on your project and select Properties, and then on the Properties page select the Application tab.

    It will have a selection for which framework you want the program to target.  


    Tom Overton
    • Marked as answer by NeOFrEaK Thursday, September 8, 2011 6:14 AM
    • Edited by Tom_Overton Thursday, September 8, 2011 6:15 AM
    Thursday, September 8, 2011 6:13 AM
  • Tnx, but the problem is that I don't have the source code for the important program it's not mine and Visual Studio wont start after I uninstalled framework 4.0 ( I had to uninstall it because the program could not find the version of runtime because after fw 4.0 got installed the program was useless.. :S it seems like after fw 4.0 got installed the 3.5 is not available)
    Thursday, September 8, 2011 6:17 AM
  • Yeah you don't want to uninstall 4.0 or that will break VS 2010.  You would have been okay having .NET framework 4.0 on there because it is backwards compatible to 3.5.  Versions 3.5, 3.0, and 2.0 all run in the CLR 2.0 and framework 4.0 runs under CLR 4.0 but 4.0 can fully handle any application that uses 3.5.

    For an overview of how the frameworks work, see this documentation:

    http://msdn.microsoft.com/en-us/library/bb822049.aspx

    Try to re-install 4.0 if you can.  IF Visual studio is still broken, then you may need to start fresh and uninstall visual studio and then install it again (which will also install 4.0 framework for you of course).


    Tom Overton
    • Edited by Tom_Overton Thursday, September 8, 2011 6:28 AM
    • Marked as answer by NeOFrEaK Thursday, September 8, 2011 6:39 AM
    Thursday, September 8, 2011 6:27 AM
  • You actually may need to do a side by side install if you have a program that runs under 3.5 though.  But get visual studio 2010 up and running again first, and then come back and install 3.5 if you need to (you said the program originally failed so maybe you do need to).
    Tom Overton
    Thursday, September 8, 2011 6:33 AM
  • Hi

     

    You can add a configuration to your program  that needs framework 3.5 xxx.config where you specify which framework it supports. There are more information about that here:

    http://msdn.microsoft.com/en-us/library/w4atty68(v=VS.85).aspx

    This would make the app run with .Net framework 3.5 and you can install VS2010 without problems.


    Torben Christiansen http://snatchedmoments.blogspot.com/
    Thursday, September 8, 2011 6:54 AM
  • There is no problem with having multiple .NET Frameworks installed on a single machine. You can have .NET 4.0 AND .NET 2.0/3.0/3.5 (2.0, 3.0 and 3.5 are all one framework. 2.0 is the base, full, framework. 3.0 and 3.5 are extensions to 2.0) on your PC.

    If you are the user of a program developed by somebody else, and don't have the original Visual Studio project, you CANNOT change which framework version that program uses.

    As far as issues with Visual Studio 2010 after removing .NET Framework 4.0 are concerned, you must first reinstall .NET Framework 4.0, then repair your VS 2010 installation.

    Thursday, September 8, 2011 1:13 PM