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)
Drag a button onto a form, click the button to create a simple event handler
The following code as you might guess creates the following program
Double click the properties folder in Solution Explorer, select the application tab and check the client profile checkbox
Select the publish tab on the left and click on prerequisites
Here you should find the following options pre-selected, if not, select them
Now create a c:\deploy folder (at the top) and click “publish now” at the bottom
You should now have your files in a folder called deploy on your c:\ drive
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
After accepting the license agreement, the client framework is installed
Once this has completed, you should be prompted to install the HelloWorld program
You can then test the application to see that it works
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
Here the download size is 60 MB but look what it installs
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
If I look at the .NET framework folder in Vista the size is 129MB (and this is .NET 3.5 SP1)
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.