views:

117

answers:

3

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?

A: 

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

Jason Irwin
You can only change the target framework in VS2008 (and later, I presume). The OP is using VS2005.
Andy
This is an ASP.NET project, I don't see the option you indicated above.
Brettski
Wow, I'm not sure how I missed that. It's been a long week - my apologies
Jason Irwin
+3  A: 

Autogenerated properties require C#3.0 which isn't available in VS2005. You need to use VS2008 to get the autogenerated property syntax.

tvanfosson
+6  A: 

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.

Andy
.NET 3.0 was released before vs2008, how were we to use the new framework when it was released?
Brettski
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.
Andy