ChatGPT解决这个技术问题 Extra ChatGPT

.NET Framework 4.0 Client Profile vs .NET Framework 4.0

When I started new .NET Console Application in VS2010, By default Target Framework was set to .NET Framework 4.0 Client Profile, what is the difference between .NET Framework 4.0 and .NET Framework 4.0 Client Profile

I do notice that I am not able to use assemblies compiled against the .NET Framework 4.0, if I am targetting the .Net Framework 4.0 client profile in my project.

M
Malartre

Straight from the Microsoft castle:

What is it: The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features.

Why: This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile.

.NET Framework Client Profile:
http://msdn.microsoft.com/en-us/library/cc656912.aspx


But the Full .NET 4.0 Framework is not much bigger than the client profile. (48 MB against 41 MB). So why should i use the .NET Client Profile? If the size is the only difference, it makes no sense to use it.
Just a side note: I am using some old 3rd party libraries (company is too cheap to get current version) that is built on 2.0. Using client profile, it would not load the libraries. Works just fine with the full framework.
@BitKFu that's just the installer size. Once installed onto your hard disk, the full .NET 4.0 framework takes up 110MB more than the .NET 4.0 framework client profile.
K
KyleMit

The client profile attempts to restrict the set of referenced assemblies to those that are only interesting to a client application. For example it won't make System.Web available by default because it is not typically valuable to client apps.

The intent is to constrain the Visual Studio experience to that which is necessary to complete your application.


S
S.L. Barth

Come from Microsoft MSDN

Project Templates that Target the .NET Framework Client Profile

Several project templates in Visual Studio 2010 target the .NET Framework 4 Client Profile. The following is a list of the project templates in Visual Studio 2010 that target the .NET Framework 4 Client Profile by default. All other projects target the .NET Framework 4 by default.

Windows

WPF Application

WPF Browser Application

WPF Custom Control Library

WPF User Control Library

Windows Forms Application

Windows Forms Control Library

Console Application

Empty Project

Window Service

Office

All Office 2007 and Office 2010

project templates

WCF

WCF Service Library

Workflow

Activity Designer Library

Activity Library

Workflow Console Application

Visual F#

F# Application

F# Tutorial


X
XP1

Kindly note the features not in the .NET Framework Client Profile.

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:

ASP.NET

Advanced Windows Communication Foundation (WCF) functionality

.NET Framework Data Provider for Oracle

MSBuild for compiling