如何在VS2005中使用.NET 3.0?

时间:2021-11-24 07:21:48

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?

我试图在VS2005中使用自动实现的属性。我在我的机器上加载了.NET 3.0框架,但Visual Studio仍在使用.NET 2.0进行编译。如何告诉它使用.NET 3.0?

3 个解决方案

#1


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.

不幸的是,我认为不可能这样做,因为这是C#编译器的一个特性。 Visual Studio 2005是硬编码的,使用C#2.0编译器。您需要升级到Visual Studio 2008才能使用新的C#3.0功能。

#2


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

自动生成的属性需要C#3.0,这在VS2005中不可用。您需要使用VS2008来获取自动生成的属性语法。

#3


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

转到您的项目属性。在应用程序选项卡下,您可以更改目标框架

#1


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.

不幸的是,我认为不可能这样做,因为这是C#编译器的一个特性。 Visual Studio 2005是硬编码的,使用C#2.0编译器。您需要升级到Visual Studio 2008才能使用新的C#3.0功能。

#2


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

自动生成的属性需要C#3.0,这在VS2005中不可用。您需要使用VS2008来获取自动生成的属性语法。

#3


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

转到您的项目属性。在应用程序选项卡下,您可以更改目标框架