.net - 什么时候是使用 .NET Framework 4 而不是 .NET Framework 4 Client Profile 的合适时机?

标签 .net .net-client-profile

也许这里的问题是我不完全理解 .NET 4 的客户端配置文件和(常规?)版本的 .NET 4 之间的差异...

当我在 Visual Studio 2010 中开始一个新项目时,它默认为 .NET Framework 4 Client Profile 的目标框架。有时,当使用第三方库时,如果我的项目设置为 .NET Framework 4 Client Profile,我会遇到编译错误 - 切换到 .NET Framework 4 可以解决此问题。

我一直只是处理这个问题,但今天我决定提出一个问题并弄清楚何时使用其中一个而不是另一个,以及为什么有两个版本的框架。

编辑:如果我以 .NET 4 为目标,我是否应该担心普通桌面用户无法通过 Windows 更新获取该框架?

最佳答案

关于您的编辑:请看这里:.Net Framework 4 Full and Net Framework 4 Client Profile Targeting

这篇文章作者Scott Hanselman向您显示客户文件中的内容和内容:

Towards a Smaller .NET 4 - Details on the Client Profile and Downloading .NET

  • 支持 Full 的所有操作系统
  • 支持 x86 和 x64
  • 客户端配置文件是将在桌面版 Windows 更新上提供的框架
  • 支持 VS 的各个方面(例如定位、部署项目等)
  • 是几乎所有 VS10 客户端项目模板(Winforms、WPF、VSTO 等)中的默认目标

这是有趣的部分:

The general idea is that they avoid installing things you don't need on a client machine. That means they won't install ASP.NET on your Mom's computer just because she wants a game. Also, the .NET 4 Client profile is a proper subset of the .NET 4 "Full" Framework.

这里有更详细的帖子:What’s new in .NET Framework 4 Client Profile RTM

When to use NET4 Client Profile and when to use NET4 Full Framework?
NET4 Client Profile:
Always target NET4 Client Profile for all your client desktop applications (including Windows Forms and WPF apps).

NET4 Full framework:
Target NET4 Full only if the features or assemblies that your app need are not included in the Client Profile. This includes:

  • If you are building Server apps. Such as:
    o ASP.Net apps
    o Server-side ASMX based web services
  • If you use legacy client scenarios. Such as:
    o Use System.Data.OracleClient.dll which is deprecated in NET4 and not included in the Client Profile.
    o Use legacy Windows Workflow Foundation 3.0 or 3.5 (WF3.0 , WF3.5)
  • If you targeting developer scenarios and need tool such as MSBuild or need access to design assemblies such as System.Design.dll

值得一提的是,从 .NET 4.5 开始,不再有客户端配置文件。已停产:http://msdn.microsoft.com/en-us/library/cc656912.aspx (链接由CodingWithSpike提供)

关于.net - 什么时候是使用 .NET Framework 4 而不是 .NET Framework 4 Client Profile 的合适时机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12302985/

相关文章:

时间:2019-03-08 标签:c#.netdatagridviewSelectionChanged

visual-studio-2010 - “.NET Framework 3.5 SP1 客户端配置文件”先决条件

c# - .net 4.0 客户端配置文件中的 LINQ to JSON

.net - Microsoft .NET 4.0 完整框架和客户端配置文件之间的差异

c# - 无法在客户端 PC 上安装 .NET 应用程序

c# - 在 linq-to-sql 查询中将字符串转换为 int : how to deal with values which cannot be converted?

c# - 无法安全锁定 ConcurrentDictionary 的值

c# - 在浏览器保存对话框中显示 Response.Binarywrite 或打开新窗口并在保存后关闭

wix - 引导 .NET 4 客户端配置文件的完整 WiX 3.6 bundle 示例