Is the .NET Framework Too Big?

Parsing the .NET redistributable download


November 04, 2003
URL:http://www.drdobbs.com/is-the-net-framework-too-big/184416881

Size isn’t everything, despite what I read in all the spam e-mail I receive. When the .NET framework was first released, it was apparent to me that there was two parts to the library. On the one hand, there are classes that follow a new paradigm and a more object-oriented fashion, for example the various streams APIs. However, there are other parts of the framework that are merely thin wrappers over Win32. You could argue that this implies that the Win32 API was well designed, but equally so, you could also argue that that the time was not spent on designing a more object-oriented API. I have always felt that the framework library was released too early, and I think something can be done about this.

The framework library is huge. If you scan through the list of framework classes, you’ll find that just about (but not completely) everything in Win32 is covered. Look at this list: WMI, Active Directory, OLEDB, XML, XSL, XPath, COM+, MSMQ, Sockets, cryptography, Windows Forms, and GDI+. I have included GDI+ because it is a Win32 feature, and the .NET framework merely provides wrapper classes. In a similar way, Windows Forms is really just a managed version of Visual Basic Forms. Now ask yourself, if you are writing an application, how many of these libraries will you use? In addition, there are some parts of the framework that are completely new: assembly probing, binding and versioning, metadata, configuration, instrumentation, isolated storage, CodeDOM, contexts, .NET Remoting, object serialization, code access security, role-based security, and ASP.NET. I include ASP.NET in this list of new features because it bears little resemblance to ASP, and web controls were a totally new feature. Again, you are unlikely to use all of these features in your application.

However, when you download the .NET redistributable, you get all of these libraries in one large, 24-MB download. If you have a dial up connection, 24 MB is not trivial: If you pay by the minute for that connection, 24 MB can get expensive. I propose that the framework should be split up into smaller redistributables. The basic framework can be found in the mscorlib and system assemblies, with some support DLLs such as fusion.dll, mscorwks.dll, and mscorjit.dll. In general, the optional parts of the framework are in separate assemblies like System.EnterpriseSetrvices and Syste.Windows.Forms.

I have listed all the files in the redistributable for v1.1 of the framework in the download for this newsletter and I have tried to categorize the files according to the type of application that will use them. My results are:

Core Library 16,354,950
Core and Language Support 17,250,793
ASP.NET 4,296,442
Data 1,653,946
Deployment 52,364
Development Tools 5,449,680
Enterprise Development 2,665,313
VS.NET Assemblies 2,231,808
Windows Forms 2,572,288
Grand Total 23,745,895

Some of the files in the “core” library are used to support other languages (Managed C++, Javascript, and VB compatibility in VB.NET), so if those are removed (so that the library only has assemblies from “pure” .NET languages like C# and VB.NET without VB compatibility) then the “core” library is reduced to 16.2 MB. The runtime comes in a workstation and server versions, and both DLLs are provided in the redistributable. You will only use one of these versions on your machine, so by having a redistributable for both versions and installing the correct version, the size of the redistributable can be reduced by a further 2.5 MB. Finally, configuration is based on XML files, which means that the large file, System.Xml.dll, is required. However, its unlikely that the configuration code uses all of the classes in this assembly; a lean version of the configuration parser could reduce the redistributable file by a further megabyte. Thus, I estimate that the redistributable could be reduced to about 12.7 MB. As a comparison, the Sun Java Runtime Environment 1.4.2 is a 14.3 MB download.

In the next newsletter, I will investigate this further by looking at the DLLs that are loaded when your application starts. In the meantime, take a look at the Weblog of my friend and Socket guru, Zane Thomas (http://abderaware.typepad.com/) for more opinions about the size of the .NET framework.


Richard Grimes speaks at conferences and writes extensively on .NET, COM, and COM+. He is the author of Developing Applications with Visual Studio .NET (Addison-Wesley, 2002). If you have comments about this topic, Richard can be reached at [email protected].

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.