The .NET Framework Client Profile


In a previous post, I discussed the benefits of the .NET Client Profile, but this was still beta and had not been released (though it has now been released in Visual Studio 2008 SP1).

Presently, this is only of benefit to XP machines, but its function will certainly be beneficial to Vista or future Windows versions, as the .NET versions increase. Essentially, all the server or developer specific libraries are removed, leaving application specific libraries only (why was this not thought of sooner?). If one is thinking of deploying a .NET 3.5 SP1 application today on XP, an installation of .NET 2.0, 3.0., 3.5. and associated service packs is required. The resultant package, is a download or install that is hundreds of megabytes large (or so it seems).

The .NET Client Profile is designed to be installed via the Microsoft Website. If installation is required locally then a webserver must be created and one must go through a few tedious steps. My own thoughts are this was unwise of Microsoft, as there are loads of developers who just want to create a setup CD with all the necessary files, without creating a dependency on the Internet in order to deploy an application.

Nevertheless, create a new project (we’ll create a simple “hello world” application)

HelloWorld1

Drag a button onto a form, click the button to create a simple event handler

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HelloWorld
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Hello World, this is the new client profile");
        }
    }
}

The following code as you might guess creates the following program

HelloWorldMessage

Double click the properties folder in Solution Explorer, select the application tab and check the client profile checkbox

HelloWorld2

Select the publish tab on the left and click on prerequisites

HelloWorld3

Here you should find the following options pre-selected, if not, select them

HelloWorld4

Now create a c:\deploy folder (at the top) and click “publish now” at the bottom

deploy

You should now have your files in a folder called deploy on your c:\ drive

deployFiles

I have a test XP machine that I have copied the files to, and clicked setup.exe to install the program. You should see a dialogue to install the client profile

SetupOfPRofile

After accepting the license agreement, the client framework is installed

Installing

Once this has completed, you should be prompted to install the HelloWorld program

InstallProgram

You can then test the application to see that it works

Actual Program

So why go through the bother of doing this? If you click into the windows folder on the XP machine and right click the .NET framework folder you can review its size which is approximately 53 MB in size.

I have another test XP test machine (for comparison) that also just has XP service pack 3. I have selected to install the full .NET framework 3.5 using the bootstrapper

DotNetAgain

Here the download size is 60 MB but look what it installs

DotNetThreePointFive

What you get is 455MB of framework code, but beware! Size information in XP is misleading. If you look at the .NET framework folder in c:\windows, you soon see that the actual size is around 110MB

FullDotNet

If I look at the .NET framework folder in Vista the size is 129MB (and this is .NET 3.5 SP1)

VistaDotNet

I know code does get installed in other places but as you can see the code you need to install is at least halved with the client profile.

3 thoughts on “The .NET Framework Client Profile

  1. I thought as much. The problem that this presents is that vista developers cannot target the the client framework if they want their application to run on both XP and Vista, which is a shame.

    Nevertheless, this is the way forward because as the .NET framework inflates to .NET 4.0 and then 5.0 you basically have a trimmed down “client” version, and a “server” version with all the trimmings.

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