Thursday, April 28, 2011

How do I use .NET 3.0 in VS2005?

I am trying to use Auto-implemented properties in VS2005. I have .NET 3.0 framework loaded on my machine, but Visual Studio is still compiling with .NET 2.0. How do I tell it to use .NET 3.0?

From stackoverflow
  • Go to your project properties. Under the application tab you can change your Target Framework

    Andy : You can only change the target framework in VS2008 (and later, I presume). The OP is using VS2005.
    Brettski : This is an ASP.NET project, I don't see the option you indicated above.
    Jason Irwin : Wow, I'm not sure how I missed that. It's been a long week - my apologies
  • Autogenerated properties require C#3.0 which isn't available in VS2005. You need to use VS2008 to get the autogenerated property syntax.

  • Unfortunately, I don't think it is possible to do this, since that is a feature of the C# compiler. Visual Studio 2005 is hard-coded to use the C# 2.0 compiler. You need to upgrade to Visual Studio 2008 to use the new C# 3.0 features.

    Brettski : .NET 3.0 was released before vs2008, how were we to use the new framework when it was released?
    Andy : At the time, there was a WPF CTP, and a WCF CTP that added the ability to write .NET 3.0 apps to VS2005. Since VS2008 supports them by default, those CTPs are no longer supported.

0 comments:

Post a Comment