Click here to Skip to main content
13,050,614 members (91,169 online)
Click here to Skip to main content
Add your own
alternative version


25 bookmarked
Posted 25 Feb 2007

Use RegFree to Solve DLL Hell Even With COM Clients

, 25 Feb 2007
Rate this:
Please Sign up or sign in to vote.
An article on using the RegFree capabilities of XP SP2 to solve DLL Hell.


This article presents a method of using the RegFree feature even with COM client applications. RegFree is a new capability of Windows to use a local XML file rather than the Registry for the interface details.

Note: "Registry Free" COM is available only on Windows XP SP2, Windows Server 2003, or newer Windows OSs. If you are working with one of these, then you can take advantage of the following method from both your unmanaged applications (COM) as well as your managed ones.


Prior to .NET, COM components needed to be globally registered on the machine. It was assumed that any new version of a component would replace the previous version, but maintain compatibility with the older version's clients. The term DLL Hell arose to describe the situation in which that compatibility was not preserved. Here is an example of such a situation:

  1. Your application requires the latest version of a third-party OCX.
  2. An application on your customer's machine requires an older version of that third-party OCX.
  3. Neither application works with the OCX version required by the other application.

How to Create the XML Manifest

RegFree COM works by expressing all of the standard component registration information that is typically installed into the system Registry in a file that can be stored in the same folder as the application itself. Getting this file is the difficult part. Luckily, Visual Studio 2005 can do 99% of the work required regardless of whether your client is .NET or VB, or even if you are not the developer of the client.

The method is to create a dummy project (named "Dummy") in VS 2005, set a reference to the COM component(s) you wish to create the XML manifest for, and set its "Isolated" property to True.

When you build the project, the bin/debug or bin/release folder will then have a file titled "Dummy.exe.manifest".

  1. Rename the "Dummy" portion of this file to match your executable.
  2. Open the manifest, and search and replace "Dummy" with the name of your executable.
  3. Finally, place the file in the same location as your executable, along with the copy of the third party component(s) that you require.

Now, it doesn't matter what version of that third-party component is registered on the machine, your application will always use the one in its executable directory.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Canada Canada
Darrin Doherty is founder and CEO of Anjin Consulting Inc., providing custom solutions to the field service industry. Their latest online endeavor is, helping companies protect their online reputations.

You may also be interested in...


Comments and Discussions

Questionexported from a .NET assembly and cannot be added as a reference Pin
Patrick Wolf15-Apr-07 15:19
memberPatrick Wolf15-Apr-07 15:19 
GeneralPrerequisits to make this work Pin
jerchap27-Feb-07 6:04
memberjerchap27-Feb-07 6:04 
GeneralRe: Prerequisits to make this work [modified] Pin
DarrinDoherty27-Feb-07 6:58
memberDarrinDoherty27-Feb-07 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 25 Feb 2007
Article Copyright 2007 by DarrinDoherty
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid