您的位置:首页 > 编程语言 > C#

visual studio 2010 C#编程时 没有.NET framework 2.0目标框架的解决办法

2012-08-27 14:34 661 查看
解决办法是安装Framework .NET 3.5 Sp1

因为visual studio 2010是依赖.NET Framework 3.5 Sp1来识别其它版本的.NEt framework的。

如果你的电脑上装了.NEt framework 2.0 .NEt framework3.0 和.NEt framework 4.0,而没有装.NEt framework3.5 sp1的话,vs 2010只能识别到4.0版本的目标框架。

下面文章是来自官方的解释:http://blogs.msdn.com/b/webdev/archive/2010/04/22/framework-net-3-5-sp1-required-for-targeting-lower-frameworks-2-0-3-0-and-3-5-multi-targeting-using-visual-studio-2010.aspx

Framework .NET 3.5 Sp1 required for targeting frameworks 2.0, 3.0 or 3.5 (multi-targeting) using Visual Studio 2010

Web Development Tools Microsoft
22 Apr 2010 4:02 PM

5

We have had some customers ask why they are unable to target earlier frameworks .NET 2.0, 3.0 or 3.5 using Visual Studio 2010. Targeting earlier frameworks (also known as Multi-targeting) is in-fact fully supported in VS 2010, but there is apre-requisite
that .NET Framework 3.5 Sp1 must be installed on the machine for VS 2010 to be able to targetany of the earlier frameworks 2.0, 3.0 or 3.5.

During VS 2010 installation, only the latest 4.0 version of the .NET framework will be installed on your machine as part of the Visual Studio installation. So if 3.5 Sp1 was not already present on your machine, you will see only the .NET Framework 4 in the
target framework dropdown of the New Website / New Project dialogs (In these dialogs, framework dropdown is available in VS Professional and higher skus only) when creating a new website or in the property pages when changing the target of an existing website
(In property pages, framework dropdown is available in the VWD Express sku as well). You can click on the ‘More Frameworks’ link and that will take you to the download page for .NET 3.5 Sp1 (see Figure 1).

Figure 1





Once .NET 3.5 Sp1 is installed on your machine, restart Visual Studio and you should be able to see the lower frameworks .NET 2.0, 3.0 and 3.5 in the Visual Studio dropdowns (see figure 2).

Figure 2





Multi-targeting – Learn More

To learn about the multi-targeting capabilities of Visual Studio 2010, see our earlier blog posts and MSDN documentation:

Visual Studio Multi-Targeting Overview (MSDN Documentation)
Multi-targeting of web projects using Visual Studio 2010
Targeting earlier .NET frameworks 2.0, 3.0, 3.5 using Visual Studio 2010
Visual Studio 2010 Property Grid Filtering

Thanks,

Bala Chirtsabesan | Visual Web Developer Team
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐