Udostępnij za pośrednictwem


.NET Framework 4 Client Profile - Introduction

Introduction

Hopefully folks have seen Soma’s and Jason Zander’s blogs announcing the availability of Beta 1 of Visual Studio 2010 and .NET Framework 4.
In .NET Framework 4 we introduced a streamlined subset and more compact version of the .NET Framework called the Microsoft .NET Framework 4 Client Profile. The goal of the Client Profile is to improve the deployment size, time, reliability and overall deployment experience for client application users.

The Client Profile contains the functionality that most common desktop client applications (including Windows Forms and WPF applications) would need, so we expect that many client application developers will use it. This will improve the overall application deployment experience when the application requires .NET Framework 4 to be installed.

One of the most important improvement is that Microsoft .NET Framework 4 Client Profile is now supporting all platforms and OS's that are supported by the full Framework including Vista, XP, Win2k3, Win2k8, Windows7, x86/x64 (excluding IA64)

We still expect some applications to target the full .NET Framework 4 if they need to use features that are not included in the .NET Framework 4 Client Profile.

Client Profile in Visual Studio 2010

Visual Studio 2008 introduced multitargeting for application projects to target 2.0 and 3.x versions of the .NET Framework. Visual Studio 2010 has improved multi-targeting in order to allow developers to easily target the new .NET Framework 4 Client Profile.

In Beta 1, when you create a new Windows Forms or WPF application, it targets the full framework by default. To change to targeting to the Client Profile, open the project properties, select the "Application" page, and change the “Target Framework” drop-down to “.NET Framework 4.0 Client Profile.”

C# project example:

image

VB project example (Project Properties > Compile tab > “Advanced Compile Options…”):

image

Notice that if you right-click the project and select “Add References…”, the dialog will show only the .NET Framework assemblies that are part of the Client Profile. This is accomplished by using reference assemblies, metadata-only versions of assemblies. The .NET Framework 4 Client Profile Reference Assemblies are located in

%programfiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client

At compile time, the reference assemblies are matched up against the known "Client List" assemblies that are included in the Client Profile. If the project has a reference to a .NET assembly that is not included in the "Client List", Visual Studio will display compile-time errors in the Error List.

Similar to the .NET 3.5 Framework SP1 Client Profile, the project adds a configuration file (app.config) that will specifically declare the application as a "client" application. This declaration indicates to the CLR loader that you are trying to run a Client Profile application. Without the configuration file, the CLR loader thinks that you are trying to run full .NET 4, and if the machine only has the Client Profile installed, it prompts ebd-user to install the full .NET 4. [Note: this functionality is not available in Beta1.]

Enhancement in 4.0 Client Profile vs. 3.5 SP1 Client profile:

Although the concept of a Client Profile is not new and was introduced in .NET Framework 3.5 SP1, the 4.0 Client Profile contains important improvements:

 

.NET Framework 4 Client Profile

.NET Framework 3.5 SP1 Client Profile

Supported OS

Supported on all platforms and  OS's that are supported by the .NET Framework (excluding IA64 and Server Core role in W2K8)

Supported only on Windows XP 32-bit machines that did not have any .NET Framework version installed.

(Client Profile will install the full 3.5 SP1 Framework under the covers otherwise)

Redistributable

Supports redistributable as well as web download

Supports Web download only

Add Remove Programs entries

The full Framework comprises the Client Profile and another part called “Extended” thus it has two entries in the  Add Remove Programs dialog (or Programs and Features window).

To remove (or repair) the full Framework you must remove the Extended part first, then the Client part.

If you installed the full Framework, you can go to the Client Profile by removing “Extended” from Add/Remove Programs.

Single entry in Add Remove Programs

Visual Studio

Improved support for Client Profile targeting in Visual Studio 2010

 

Features

Includes new .NET 4  features (such as Managed Extensibility Framework (MEF), C# 4 Dynamic Keyword, etc)

 

What’s in and what’s not included in the Client Profile:

Features

full Framework

Client Profile

Common Language Runtime

   

Can be installed side-by-side with older versions of the Framework

In-process side by side support

Improved COM interop

     

Innovations in the Visual Basic and C# languages

   

statement lambdas

implicit line continuations

dynamic dispatch

named/optional parameters

     

Base Class Library Improvements

   

Managed Extensibility Framework

Additional core data structures

I/O Improvements

     

Parallel Computing Innovations

   

Task Parallel Library (TPL)

Parallel LINQ (PLINQ)

     

ADO.NET

   

REST-based exposure of relational data

Entity Framework, LINQ to Entities

SqlClient, OLEDB, ODBC Managed Providers

XML, LINQ to XML

OracleClient

 

LINQ to SQL

 

Runtime design libraries for Entity Framework and ADO.NET Data Services

 
     

ASP.NET Innovations

 
     

ASP.NET AJAX Improvements

 
     

XAML Parser

   

Faster

More extensibility during XamlReader.Load and XamlWriter.Save

Ability to use generics               

Better References by Name

     

Windows Communications Foundation

   

WCF Client Component

WCF Workflow Services

Service discovery

 

Router service

 

Simplified configuration

Improved queuing

REST support

Improved performance

     

Windows Presentation Foundation

   

New line-of-business controls including charting control, smart edit, data grid, and others that improve the experience for developers who build data centric applications

Support in for Windows 7 multi-touch, ribbon controls, and taskbar extensibility features

Added support in WPF for Surface 2.0 SDK

     

Windows Workflow Foundation

   

Improved activity programming model

 

Improved designer experience

 

New flowchart modeling style

 

Expanded activity palette

 

Workflow-rules integration

 

New message correlation features

 

Significant performance gains for WF-based workflows

 

Miscellaneous

 

 

Speech support

 

Various perf counters

 

MSBuild support

 

Visual Basic compiler and other compilers

 

• Full Support

Partial Support

 

Download and feedback

Please download the Client Profile from the download site here and provide us with feedback. We really would love to know:

  • What do you feel should be the size of the Client Profile?
  • Does it currently contain the right features set? What functionality is missing?
  • To reduce size, what functionality should be removed?
  • How easy it is to use in Visual Studio 2010?
  • Any other feedback?

Notes and caveats:

  • Redistributable package size for the Client Profile is not final (it is currently at ~34MB). Expect to see a smaller size by RTM. Web installer is also not supported in Beta 1
  • Note that the setup package file name includes the word “Client” vs. “Full” to differentiate between the two packages. (e.g. dotNetFx40_Client_x86.exe, dotNetFx40_Full_x86.exe)
  • Setup may require a reboot, depending on the OS and currently running programs during installation.
  • No bootstrapper package is available yet, so you will not find the .NET Framework 4 ClientProfile in Visual Studio 2010's "Prerequisites" dialog in the project's "Publish" property tab.
  • We are still tweaking what should be included in Client Profile vs. full Framework, so it is very likely to change before RTM.
  • Support for the Client Profile Configuration Designer is not available in Beta 1 and likely will not be available before RTM.

Comments

  • Anonymous
    May 27, 2009
    PingBack from http://microsoft-sharepoint.simplynetdev.com/net-framework-4-client-profile-introduction/

  • Anonymous
    May 27, 2009
    Thank you for submitting this cool story - Trackback from DotNetShoutout

  • Anonymous
    May 27, 2009
    Cool feature - it seems this would be even more useful on mobile devices. Any plans for this feature to make it into the .Net Compact Framework? Thanks, Mike

  • Anonymous
    May 27, 2009
    As I had mentioned in my previous posts, .NET Framework 4 brings the concept of .NET Framework 4 Client

  • Anonymous
    May 27, 2009
    I am late to this  but still wanted to share an “insider view” into the status of “WPF 4” in the

  • Anonymous
    May 28, 2009
    Thank you for submitting this cool story - Trackback from progg.ru

  • Anonymous
    May 28, 2009
    The comment has been removed

  • Anonymous
    June 04, 2009
    can i have system.speech.synthesis TTS feature in client profile please ?

  • Anonymous
    January 11, 2010
    How do I know whether it is being compiled under .net 4 client profile or full version. any pargams #if NET_4_0  #if CLIENT_PROFILE    //.. do something  #endif #endif

  • Anonymous
    January 13, 2010
    prabirshrestha, One approach you can take is add this at the bottom of your project file: <PropertyGroup>  <DefineConstants Condition=" '$(TargetFrameworkVersion)' == 'v4.0' ">$(DefineConstants);NET_4_0</DefineConstants>  <DefineConstants Condition=" '$(TargetFrameworkProfile)' == 'Client' ">$(DefineConstants);CLIENT_PROFILE</DefineConstants> TargetFrameworkProfile </PropertyGroup> This will define the symbols you used in your example when they apply.

  • Anonymous
    January 13, 2010
    The comment has been removed

  • Anonymous
    April 25, 2010
    Hi Jossef, i develop wpf 4.0 app in VS 2010, how can i use Client Profile Configuration Designer. Where does it locate? I can't find it. Is there way to use "Client Profile Configuration Designer from .NET 3.5 SP1"? Is there workaround for  .NET framework 4.0 Client Profile? Thanks. Martin