.NET Availability and Viability With Portable Apps
John T. Haller, (Last Updated: November 12, 2010, Originally Posted: August 16, 2007)
A few people have asked about whether certain .NET-based applications can be made into portable apps. For the unfamiliar, .NET is a software component that provides a number of pre-built libraries as well as a runtime manager. Applications written with .NET require the proper version of the .NET runtime be installed in Windows to run. More details on what .NET is are available in the Wikipedia article on the .NET Framework.
Multiple Versions, Some Compatibility Issues
.NET is currently available in five different versions (1.0, 1.1, 2.0, 3.0 and 3.5), 10 if you count the various service packs. In many cases, applications written for one version of the .NET framework will work on a later version. In some cases, certain changes will break some applications or features, however. Microsoft refers to these as "Breaking Changes" (Example: 2.0 Breaking Changes). So, for example, some .NET 1.1 applications will run just fine on a PC with only the .NET 2.0 runtime installed whereas others will not run unless the .NET 1.1 runtimes are installed.
.NET Framework Runtime Bundling and Installation
The .NET Framework has only been bundled with Windows for the last couple years (Windows Vista includes 3.0, Windows 7 includes 3.5). For all other versions of Windows, the .NET runtime must be downloaded and installed on each PC by a user logged on with administrative privileges. The download size ranges from 50MB - 195MB depending on configuration. The .NET Framework is made available for direct download from Microsoft's website as well as Windows Update where it is listed as an optional update (see screenshot). Most users only apply critical/high priority updates as these are the only ones Windows is configured to automatically apply. The installation process can take 15 minutes or more and requires closing all running programs and restarting the PC, so even in a situation with admin rights, installing and then removing is unreasonable.
Several people have also asked about whether .NET itself can be made portable. The answer is no. .NET is heavily tied to the Windows operating system and requires an administrator to install. Plus, it is a closed source, commercial product, so, legally, we couldn't do it, anyway. So, we're left with just analyzing what PCs already have it and what PCs can have it added.
.NET Framework Availability By Version and Operating System
Using the compatibility information by operating system, compatibility of .NET versions with each other, bundling information with operating system and some quick overview statistics of operating system usage online, I've compiled a quick chart that shows you where .NET can be expected, where it's available for download and where it simply won't work.
|% of Windows PCs||.NET Version||1.0||1.1||2.0||3.0||3.5||4.0 RC|
|Windows 95||0.00%||Not Available||Not Available||Not Available||Not Available||Not Available||Not Available|
|Windows NT||0.23%||Download||Download||Not Available||Not Available||Not Available||Not Available|
|Windows 98||0.08%||Download||Download||Download||Not Available||Not Available||Not Available|
|Windows Me||0.04%||Download||Download||Download||Not Available||Not Available||Not Available|
|Windows 2000||0.61%||Download||Download||Download||Not Available||Not Available||Not Available|
|Windows PCs With .NET Version Included||34.33%||34.33%||34.33%||34.33%||20.13%||0.00%|
|Windows PCs Compatible With .NET Version||100.00%||100.00%||99.60%||99.02%||99.02%||99.02%|
Statistics from Net Applications for October 2010 adjusted to include Windows PCs only.
* Compatible indicates that most apps written for this version of the .NET framework should work out of the box on this version of Windows with the exceptions of apps that fall afoul of the "Breaking Changes" as described earlier in this document.
For those curious about the numbers if we include Mac OS, Linux, FreeBSD and Solaris in the mix (assuming it is a straight .NET app without Mono compatiblity adjustments and will not work on non-Windows OSes), the numbers are as follows:
|.NET Version||1.0||1.1||2.0||3.0||3.5||4.0 RC|
|All PCs With .NET Version Included||32.08%||32.08%||32.08%||32.08%||18.81%||0.00%|
|All PCs Compatible With .NET Version||93.45%||93.45%||93.08%||92.54%||92.54%||92.54%|
Overall, your chances of encountering a PC equipped with the proper version of the .NET Framework are relatively low. Most pre-Vista PCs in public locations (net cafes, coffee shops, libraries, hotel business centers, school computer labs, etc) simply won't have .NET installed. Of course, your personal results may vary greatly as you may be using a Vista PC at home or you may have the .NET Framework installed at work due to corporate applications that require it. Overall, however, applications based on .NET simply can't be considered portable due to the fact that the files they need can't be bundled portably and won't be on most PCs you encounter in the wild.