.NET Framework Client Profile – new in .NET 3.5 SP1


.NET Framework 3.5 SP1 (Service Pack 1) comes with a new deployment feature called “.NET Framework Client Profile”. It provides a new setup installer that enables a smaller (27 MB), faster and simpler installation experience for .NET client applications on machines that do not already have the .NET Framework installed. It’s a subset of assemblies already contained within .NET Framework 3.5 Service Pack 1.

Client Profile contains the parts of .NET Framework that is typically used in .NET client apps –

  • Common Language Runtime (CLR)
  • ClickOnce
  • Windows Forms
  • Windows Presentation Foundation (WPF)
  • Windows Communication Foundation (WCF)

To show how Client Profile works let’s create a WPF client app (you can also create a Win Forms app). Open the project property window and navigate to Application tab.

Check the “Client-only Framework subset” checkbox  as shown below – (by default it’s unchecked).

 

That’s all that you need to do to use “Cleint Profile”. Once this is checked, app.config file is added in the project. Open the app.config file and you would find the following entry –

<?xml version="1.0"?>

<configuration>

  <startup>

    <supportedRuntime version="v2.0.50727" sku="Client"/>

  </startup>

</configuration>

The supportedRuntime element specifies which versions of the common language runtime the application supports. At runtime, the framework runtime will check the contents of the file, if the sku="Client" declaration is not found, the runtime will assume that this application requires the full .NET Framework and prompt the end-user to install the full .NET Framework.

Now to test how Visual Studio behaves if a .NET dll/asssmebly that’s not part of Client Profile is referenced in the project, we will add a server only .NET assembly.

So we added System.Data.Linq as project reference (System.Data.Linq contains classes of LINQ to SQL). Once the dll reference is added, build the project. You would notice two thing –

The dll just added (System.Data.Linq) is shown with missing reference (exclamation icon).

A warning mentioning System.Data.Linq is not part of Client Framework subset is shown by Visual Studio.

 

So for using Client Profile or Client Framework subset you should use only the dlls that are part of client framework subset.

Here’re few good links –

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s