When is the right time to use .NET Framework 4 rather than .NET Framework 4 Client Profile?

StackOverflow https://stackoverflow.com/questions/12302985

  •  30-06-2021
  •  | 
  •  

سؤال

Perhaps the issue here is that I don't fully understand the differences between the Client Profile of .NET 4 and the (regular?) version of .NET 4...

When I begin a new project in Visual Studio 2010, it defaults to a target framework of .NET Framework 4 Client Profile. Occasionaly, when using third party library's I will get compile erros if my project is setup for .NET Framework 4 Client Profile - switching to .NET Framework 4 fixes the issue.

I have always just dealt with this but today I decided to ask the question and figure when to use one over the other, and why there are two versions of the framework.

EDIT: If I target .NET 4, should I be concerned that a normal desktop user won't be getting that Framework over Windows Update?

هل كانت مفيدة؟

المحلول

Concerning your edit: take a look here: .Net Framework 4 Full and Net Framework 4 Client Profile Targeting

This post by Scott Hanselman shows you what's in and what's out of the Client Profile:

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

  • Supported on all OS that Full is
  • Supported for x86 & x64
  • Client Profile is the framework that will be available on Windows Update for desktops
  • Supported in all aspect of VS (e.g. targeting, deployment project, etc)
  • Is the default target in almost all VS10 Client Project Templates (Winforms, WPF, VSTO, etc)

This is the funny part:

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.

Here's a more detailed post: 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

It's worth mentioning that starting with .NET 4.5 there's no more a Client Profile. It's been discontinued: http://msdn.microsoft.com/en-us/library/cc656912.aspx (link provided by CodingWithSpike)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top