none
CLR Changes in .NET 3.5 RRS feed

  • Question

  • Hi,
    This might be a silly question, but I had to ask:

    If I am able to target frameworks 2.0 and 3.5 in VS 2008,

    - Can I use the enhancements to CLR, Threading, and Reflection in targeting 2.0?  How would it work?

    - Can I use the new language features in C# 3.0, except for LINQ, like object initializing, lambda expressions, anonymous types, etc. in application targeting 2.0? 

    Your help is greatly appreciated.



    kashif
    Monday, March 2, 2009 9:06 PM

Answers

  • Anything that requires the newer class libraries you can't use with a C# 2.0 project, however anything thats bolted onto the compiler such as labda expressions and object initalizing usually work for C# 2.0 projects (but only in the 2008 ide, it won't work for vs.net 2005),  with some tricks you can make extention methods work as well.
    • Marked as answer by Zhi-Xin Ye Tuesday, March 10, 2009 6:02 AM
    Tuesday, March 3, 2009 12:36 AM

All replies

  • No, you can't. When you target a 2.0 framework, all functionality that came with versions later than 2.0 are removed. Your solution won't even compile.
    Monday, March 2, 2009 9:34 PM
  • Anything that requires the newer class libraries you can't use with a C# 2.0 project, however anything thats bolted onto the compiler such as labda expressions and object initalizing usually work for C# 2.0 projects (but only in the 2008 ide, it won't work for vs.net 2005),  with some tricks you can make extention methods work as well.
    • Marked as answer by Zhi-Xin Ye Tuesday, March 10, 2009 6:02 AM
    Tuesday, March 3, 2009 12:36 AM