vs 2008 compiles 3.5 code regardless of target version

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fregas

    vs 2008 compiles 3.5 code regardless of target version

    With Visual Studio 2008 Microsoft also updated the C# language. C# 3.0 brings several new and useful features that are described in a MSDN article. Visual Studio 2008 will always compile with the n…


    Is it true that many of the 3.5 (or c# 3.0) features will work even if
    you are targeting the .NET 2.0 framework? This makes it very easy to
    mistakenly deploy code to your test or production environments that
    work in development but do not work on the server. Is there a way to
    cause these to become compiler errors during development so you can
    catch them early on?
  • Mark Fitzpatrick

    #2
    Re: vs 2008 compiles 3.5 code regardless of target version

    Keep in mind, the 3.5 framework is not a new framework, it is extensions to
    the 2.0 framework. So many people loose which features are available where.
    The biggest thing in 3.5 from an ASP.Net perspective was ASP.Net Ajax in the
    System.Web.Exte nsion dll. Many hosts installed this to 2.0 anyways as it was
    available as a separate download before the 3.5 framework release. The
    largest feature lost is Linq since that is only in the 3.5 framework. Most
    of the 3.0 features don't effect ASP.Net since they deal with Windows
    Presentation Foundation, Windows Workflow, and Windows Communication
    Foundation. Nothing directly added in ASP.Net. So, most of a 3.5 application
    can still work in 2.0 since they use the same core framework pieces.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression

    "Fregas" <fregas@gmail.c omwrote in message
    news:3581d25b-298c-40c0-a5fe-abbc401ece18@k3 7g2000hsf.googl egroups.com...
    With Visual Studio 2008 Microsoft also updated the C# language. C# 3.0 brings several new and useful features that are described in a MSDN article. Visual Studio 2008 will always compile with the n…

    >
    Is it true that many of the 3.5 (or c# 3.0) features will work even if
    you are targeting the .NET 2.0 framework? This makes it very easy to
    mistakenly deploy code to your test or production environments that
    work in development but do not work on the server. Is there a way to
    cause these to become compiler errors during development so you can
    catch them early on?

    Comment

    • Evan Camilleri

      #3
      Re: vs 2008 compiles 3.5 code regardless of target version

      Many features are simply 2.0 which are 'shortened' to be cooler/simpler.
      They are then extened to actual 2.0 code prior to compilation

      Evan Camilleri




      "Fregas" <fregas@gmail.c omwrote in message
      news:3581d25b-298c-40c0-a5fe-abbc401ece18@k3 7g2000hsf.googl egroups.com...
      With Visual Studio 2008 Microsoft also updated the C# language. C# 3.0 brings several new and useful features that are described in a MSDN article. Visual Studio 2008 will always compile with the n…

      >
      Is it true that many of the 3.5 (or c# 3.0) features will work even if
      you are targeting the .NET 2.0 framework? This makes it very easy to
      mistakenly deploy code to your test or production environments that
      work in development but do not work on the server. Is there a way to
      cause these to become compiler errors during development so you can
      catch them early on?

      Comment

      Working...