.NET 4.0项目中的参考问题到.NET 2.0 dll/project

Gre*_*fey 1 .net-4.0 visual-studio-2010

我刚刚开始使用Visual Studio 2010和.NET 4.0.我创建了一个新的WPF项目,一个为.NET 2.0构建的DLL.当我构建项目时,我得到了一堆像这样的警告:

The referenced assembly
"MicroFour StrataFrame Business...processorArchitecture=MSIL"
could not be resolved because it has a dependency on
"System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".
Please remove references to assemblies not in the targeted framework
or consider retargeting your project.
Run Code Online (Sandbox Code Playgroud)

当我引用我创建的目标为3.5的项目时,它找不到任何名称空间(在编译期间),尽管它们出现在对象浏览器中并且intellisense正确显示它们.

有没有我需要做的东西来引用旧的.NET程序集?

Han*_*ant 5

针对.NET 4.0的客户端配置文件没有什么意义.下载量为41MB,完整版为48MB,仅增加15%.不幸的是,它是VS2010中的默认设置,只需使用Project + Properties,Application选项卡,Target framework combo进行更改即可.

如果您的目标是3.5,则客户端配置文件确实很有意义,完整安装大约为350 MB.先决条件解释了巨大的差异,.NET 4.0至少需要XP SP3或Vista SP1.但是在任何版本的Windows> 2000上安装3.5.因此,3.5安装程序包含许多.NET使用的非托管Windows组件所需的更新.网络安装程序减轻了这个打击btw.