.net 客户资料与完整

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3562076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 14:39:01  来源:igfitidea点击:

Client Profile vs Full

.net.net-3.5.net-4.0

提问by Roman

Possible Duplicate:
Difference between .NET 4 Client Profile and Full Framework download

可能的重复:
.NET 4 客户端配置文件和完整框架下载之间的区别

I noticed that you can change the target platform in .NET applications to the Client Profile or the Full profile. What is the difference between the two? How should I choose which is the correct one for my project?

我注意到您可以将 .NET 应用程序中的目标平台更改为客户端配置文件或完整配置文件。两者有什么区别?我应该如何为我的项目选择正确的?

采纳答案by Roman

Summarized from MSDN:

MSDN总结:

When targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.

面向 .NET Framework 4 Client Profile 时,不能引用不在 .NET Framework 4 Client Profile 中的程序集。相反,您必须以 .NET Framework 4 为目标。

The .NET Framework 4 Client Profile does not include the following features. You must install the .NET Framework 4 to use these features in your application:

.NET Framework 4 Client Profile 不包括以下功能。您必须安装 .NET Framework 4 才能在您的应用程序中使用这些功能:

  • .NET Framework Data Provider for Oracle
  • ASP.NET
  • Advanced Windows Communication Foundation (WCF) functionality
  • MSBuild for compiling
  • 用于 Oracle 的 .NET Framework 数据提供程序
  • ASP.NET
  • 高级 Windows Communication Foundation (WCF) 功能
  • 用于编译的 MSBuild

Applications that target the .NET Framework 4 Client Profile typically improve the deployment experience by having smaller download sizes and quicker install times. An application that targets the .NET Framework 4 Client Profile has a smaller redistribution package that installs the minimum set of client assemblies on the user's computer, without requiring the full version of the .NET Framework 4 to be present.

面向 .NET Framework 4 Client Profile 的应用程序通常会通过更小的下载大小和更快的安装时间来改善部署体验。面向 .NET Framework 4 客户端配置文件的应用程序具有较小的重新分发包,可在用户计算机上安装最少的客户端程序集集,而无需存在 .NET Framework 4 的完整版本。

回答by Hans Passant

There is very little point in targeting the client profile for .NET 4.0. The download is 41MB, the full version is 48MB, only 15% bigger.

针对 .NET 4.0 的客户端配置文件没有什么意义。下载是41MB,完整版是48MB,只大了15%。

The client profile does make a lot of sense if you target 3.5, the full installer is ~350 MB. The huge difference is explained by the prerequisites, .NET 4.0 requires at least XP SP3 or Vista SP1, 3.5 installs on any version of Windows > 2000. The 3.5 installer thus contains lots of the required updates for unmanaged Windows components used by .NET. The web installer lessens that blow considerably btw.

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

The client profile is painful in .NET 4.0 because VS2010 made it the default .NET framework target. And deals quite poorly with a solution that has projects that have a mix of full and client profile targets, produces verymystifying build errors on code that IntelliSense doesn't complain about. They didn't make the same mistake again in VS2012, nor does .NET 4.5 have a Client profile. Good riddance.

客户端配置文件在 .NET 4.0 中很痛苦,因为 VS2010 使它成为默认的 .NET 框架目标。并且处理具有混合完整和客户端配置文件目标的项目的解决方案非常糟糕,在 IntelliSense 不会抱怨的代码上产生非常神秘的构建错误。他们在 VS2012 中没有再犯同样的错误,.NET 4.5 也没有客户端配置文件。甩掉包袱。

回答by Dominic K

The Client Profile only installs a subset of .NET that is relevant to desktop applications. This means that in some cases, you have to use the Full profile to get some features. The Client Profile is a lot smaller of course, and I would recommend it for small desktop applications.

客户端配置文件仅安装与桌面应用程序相关的 .NET 子集。这意味着在某些情况下,您必须使用完整配置文件才能获得某些功能。客户端配置文件当然要小得多,我建议将它用于小型桌面应用程序。

回答by Paul Alexander

While the difference in size is essentially negligible with modern networks, there is one major difference. Windows Update (and Windows 7 & 8 I believe) will only install the client framework on an end users machine. So the chances of the end user having the client framework already installed is much higher than the full framework.

虽然现代网络的规模差异基本上可以忽略不计,但存在一个主要差异。Windows Update(我相信 Windows 7 和 8)只会在最终用户机器上安装客户端框架。因此,最终用户已经安装客户端框架的机会比完整框架高得多。