Developing for older frameworks RRS feed

  • Question

  • Hi Guys,

    I was wondering, if I write a program on a machine that has all the .Net frameworks installed, but I really want my program to work for older frameworks, say 2.0 only, I would like to not be able to use new Classes and or functionality from the latest .Net frameworks.
    Is there a config somewhere saying my program should compile? with the 2.0 framework and thus giving errors when I use something from a later one?
    Or should I uninstall the newer versions to make this work?

    Friday, October 23, 2009 10:10 AM


  • Hi Jorbes,

    Thank you for your post.

    By default, the target version of .NET Framework in Visual Studio 2005 is .NET Framework 2.0. Visual Studio 2005 was designed for .NET Framework 2.0. If you're running Visual Studio 2005, Visual Studio 2005 does not have access to various new project and item templates and tools that support .NET Framework 3.5. If developers want to use some new features (like LINQ, AJAX) come along with .NET 3.5 which would be necessary in Visual Studio 2008 because Visual Studio 2008 compiles these new features.

    The feature of .NET Framework Multi-targeting is supported in Visual Studio 2008. It can allow you to choose which .NET Framework you want to target for the solution. However, only .NET Framework 2.0, 3.0 and 3.5 can be set to target the solution. If you're running Visual Studio 2008, you can set the target Framework to 2.0 even you have installed all the .Net frameworks. Thus, you don't need to uninstall the newer version of .NET Framework on your machine.
    For more information, please check:

    Hope this helps. If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Edited by YiChun Chen Monday, October 26, 2009 9:04 AM typo
    • Marked as answer by YiChun Chen Friday, October 30, 2009 4:24 AM
    Monday, October 26, 2009 9:03 AM