views:

787

answers:

2

I'm trying load a 3rd party DLL but I get an error when attempting to load it. Opening it in Dependency Walker shows that the DLL simply relies on kernel32.dll and msvcr90.dll. However, I get the following error in Dependency Walker when opening this DLL: Error The Side-by-Side configuration information for [full path to the dll that I am loading] contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).

The only copy of msvcr90.dll that exists on the system is one that I copied into the directory that contains my third party DLL. I ran into a very similar problem on another machine and installing the Visual C++ 2008 Redistributable package from Microsoft fixed it. However, I really need to get to the bottom of this as I can't install the redistributable package on all machines that I need this to run on.

I've also tried opening the third party DLL in Visual Studio and examined its manifest. In it I can see that it explicitly is dependent upon the SP0 version of the Visual C Runtime library:

<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

However, copying that exact version of the DLL to the machine with the problem still doesn't fix it. What gives?

+1  A: 

Ok, I figured it out. I had to include a copy of the Microsoft.VC90.CRT.manifest file. Normally, you can get this from the [Visual Studio 9.0 install dir]\VC\redist\x86\Microsoft.VC90.CRT directory. However, I had SP1 of Visual Studio installed which had slightly different versions of these files. I ultimately extracted the appropriate file from the redistributable package from MS. Obviously if I had another 3rd party DLL that depended upon a different version of the msvcr90.dll I would be in trouble. I guess this is why Microsoft created the side-by-side thing to begin with.

In short (for any potential Googlers in the future), you have two options:

  • Install the Visual C++ 2008 Redistributable package (just Google that term, you'll find it)
  • Or manually copy the necessary DLLs to your application directory including the .manifest file
Jason
If you create an installer for your application then (depending on the installer creation tool you use) this should automatically pull in the appropriate dlls or use the correct merge modules. That's usually a bit less error-prone than manually copying dlls -- which may conflict with the windows SxS (side-by-side) installation.Another alternative is to statically link against the runtime, though this may not always be practical.
the_mandrill
Thanks, that's actually probably a more correct answer than mine. I'll look into what is involved with packing a merge module with my install system. Up until now the software has been xcopy deployable which was nice in some configurations.
Jason
A: 

I have created manifest file for my.dll. my.dll has a dependency on msvcr90.dll. In auto generated manifest file contains, ( i was using MS VC++ 2008 Express Edition)

In side by side(winsxs) directory, there are three version on msvcr90.dll. my.dll started to using only the latest version of msvcr90.dll (9.0.30729.4148).

Here in below topics i need the help:

1) my.dll is using only the latest version of msvcr90.dll . if i tried to make this dll as old. My application fails to start. How to make contidion that my.dll should refer only to the version which i mentioned in manifest file.

2) how can i tell my.dll should dependent on the msvcr90.dll which i providing in the local directory along with my.dll. I want to restrict my my.dll should not do search in the system directory for the msvcr90.dll.

satishtech