XFxDetect - A utility to detect which versions of .Net are installed






4.89/5 (43 votes)
XFxDetect inspects registry and file system of local or remote computer to determine which versions of .Net Framework are installed.
Introduction
I wrote XFxDetect to help in diagnosing problems with .Net installations, because I found that some of the available diagnostic tools did a very superficial job, reporting that a .Net version was installed when it obviously was not. There are many web sites - on MSDN and private blogs - that document the registry locations and folders used by the .Net Frameworks. What was needed, I felt, was utility that cross-checked registry locations with what actually existed in file system folders. This is what XFxDetect attempts to do.
Note that XFxDetect is only a diagnostic tool - it makes no attempt to repair or modify any registry setting or file.
How It Works
When you run XFxDetect, it scans first registry and then file system for evidence of .Net Frameworks (1.0, 1.1, 2.0, 3.0, and 3.5) and their service packs. Any discrepancy between registry and what exists on disk is immediately apparent.
You can also view details of which registry settings and folders are being checked:
The Settings dialog allows you to select remote computer and to enable logging:
After selecting remote computer, click on Refresh to display the results:
XFxDetect Log File
The log file records information gathered by XFxDetect:
In the above screenshot, the five released versions of the .Net Framework (1.0, 1.1, 2.0, 3.0, 3.5) are highlighted (0 = not detected, 1 = detected). Each line indicates source of data (local or remote computer name), and whether information was collected from registry or file system.
Accessing Remote Computers
The Settings dialog (see screenshot above) allows you to select remote computer by entering computer name and, optionally, name of file share. The file share name is used to access files on the remote computer's drive where .Net Framework files are installed. Typically, this is C: drive. In some corporate environments, C: drive is set up with standard share name, such as "C". You may have to enter password before you can access remote drive - quick way to check this is to use Windows Explorer to access C: drive on remote computer. If you need to enter username and password, you will be asked for them, and then you can run XFxDetect to gather information from remote computer.Accessing remote computer registry and file system may require you to start some services that are not normally running. In the following screenshot from Vista, three services needed to be started before access was possible:
Limitations
- Currently only the standard .Net Framework folders are checked.
References
- Aaron Stebner's blog: Sample code to detect .NET Framework 1.0 and 1.1 and service packs
- Junfeng Zhang's blog: How to detect .Net framework installed or not
- How to determine which versions of the .NET Framework are installed and whether service packs have been applied. List of version numbers and service packs, using MSCORLIB.DLL.
- Deploying Microsoft .NET Framework Version 3.0. List of registry keys used in 1.0 - 3.0.
- The coding gentleman's guide to detecting the .NET Framework by Nishant Sivakumar. Nish's excellent article started me thinking about what kinds of checks could be possible.
- Using managed code to detect what .NET Framework versions and service packs are installed by Scott Dorman. Good information on .Net Framework registry values.
- .NET Framework Developer Center
- Microsoft .NET Framework Version 1.1 Redistributable Package
- Microsoft .NET Framework Version 2.0 Redistributable Package
- Microsoft .NET Framework Version 3.0 Redistributable Package
- Microsoft .NET Framework 3.5
- Microsoft .NET Framework 4.0
- .NET Framework 3.5. Blog by Daniel Moth.
Revision History
Version 2.0 — 2011 March 2
- Added support for .NET 4.0
- Converted to VS2008
Version 1.0 — 2007 June 8
- Initial public release
Usage
This software is released under the Code Project Open License (CPOL). You are free to use this software in any way you like, except that you may not sell this source code. This software is provided "as is" with no expressed or implied warranty. I accept no liability for any damage or loss of business that this software may cause.