The solution to DLL hell is hellish

March 7th, 2007

Recently I started develop things using Visual Studio 2005 SP1 (a.k.a. VS8 SP1). The biggest change of VS8 is that the CRT library is now deployed in WinSxS so that the DLL hell problem related to CRT could be solved, as suggested in Martyn Lovell’s blog.

As a result, VC linker will auto generate appropriate manifest file and embedded it into your DLL or EXE. Unfortunately, there is a new hell created by this approach. Here’s an example about how that hell happens.

I have a setup.exe using two delayed-load DLL’s, one is comp8.dll and the other is comp8sp1.dll. comp8.dll is a third-party DLL built with VC8 (CRT version 8.0.50608.0), while comp8sp1.dll is my own DLL built with VC8 SP1 (CRT version 8.0.50727.363). The VC8 linker will then generate a manifest file for setup.exe like

<dependency>
<dependentAssembly>
<assemblyIdentity type=’win32′ name=’Microsoft.VC80.CRT’ version=’8.0.50727.762′ processorArchitecture=’x86′ publicKeyToken=’1fc8b3b9a1e18e3b’ />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type=’win32′ name=’Microsoft.VC80.CRT’ version=’8.0.50608.0′ processorArchitecture=’x86′ publicKeyToken=’1fc8b3b9a1e18e3b’ />
</dependentAssembly>
</dependency>

This will cause the infamous error of “incorrect application configuration” if you try to run setup.exe on an average XP SP2 machine without installing VC8 SP1 redist file first. The problem is, this is my setup.exe and it is supposed to install that redist for me. Worst of all, VC does not provide you any warnings about that. What a hell.

Are you running into the same manifest hell? Here is the link to the right article for debugging such crap. To understand more about the side-by-side thing, CodeProject has an excellent article explaining almost everything.

C++/C#, Troubleshooting, Windows | Comments Jump to the top of this page

Comments are closed.

Chef Peon's Melange

Archives

Meta

Social Links