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
2009-04-03 22:04:15
You can only change the target framework in VS2008 (and later, I presume). The OP is using VS2005.
Andy
2009-04-03 22:07:01
This is an ASP.NET project, I don't see the option you indicated above.
Brettski
2009-04-03 22:07:22
Wow, I'm not sure how I missed that. It's been a long week - my apologies
Jason Irwin
2009-04-03 22:17:54
+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
2009-04-03 22:05:19
+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
2009-04-03 22:05:20
.NET 3.0 was released before vs2008, how were we to use the new framework when it was released?
Brettski
2009-04-03 22:08:51
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
2009-04-03 23:16:37