0

I have a third-party DLL that is built with Visual Studio 2005, which I use in a project that is built with Visual Studio 2008. This DLL depends on VS2005 CRT, version 8.0.50727.4053.

On Windows 7 it works, but on Vista and XP LoadLibrary fails with a side by side error. The is from the Event Viewer:

Activation context generation failed for "C:\MyLibrary.dll". Dependent Assembly Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.

I've tried copying msvcm80.dll,msvcp80.dll,msvcr80.dll from x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d on my computer to the same directory as the DLL, but LoadLibrary still fails and the same error is in the Event Viewer.

This is the output from sxstrace.exe:

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = x86
    CultureFallBacks = en-US;en
    ManifestPath = C:\MyDir\MyLibrary.dll
    AssemblyDirectory = C:\MyDir\
    Application Config File = 
-----------------
INFO: Parsing Manifest File C:\MyDir\MyLibrary.dll.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053"
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053".
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: Find publisher policy at C:\Windows\WinSxS\manifests\x86_policy.8.0.microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4016_none_5169e8e10f4ca52d.manifest
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.CRT\8.0.50727.4053__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\MyDir\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\MyDir\Microsoft.VC80.CRT.MANIFEST.
                INFO: Attempt to probe manifest at C:\MyDir\Microsoft.VC80.CRT\Microsoft.VC80.CRT.DLL.
                INFO: Attempt to probe manifest at C:\MyDir\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053".
ERROR: Activation Context generation failed.
End Activation Context Generation.
sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 2
    You need to download and run the appropriate vcredist. [This question and answer](http://stackoverflow.com/questions/8913543/why-installing-vcredist-x86-exe-doesnt-fix-sidebyside-error-when-i-develop-an-e) have lots of details. – arx Sep 20 '12 at 14:41
  • I forgot to mention I had already tried installing the redistributable, but it didn't work. – sashoalm Sep 20 '12 at 14:43
  • Did you install the right one? As explained in the link I gave, there are lots to choose from. – arx Sep 20 '12 at 14:43
  • I had no idea it needs to be specific. I just followed [the first result](http://www.microsoft.com/en-us/download/details.aspx?id=3387) from Google. Where do I find the right one? – sashoalm Sep 20 '12 at 14:46
  • You need the redistributable that corresponds to VS2005. – David Heffernan Sep 20 '12 at 15:03
  • @DavidHeffernan: There are loads of them! I think [this is the right one](http://www.microsoft.com/en-us/download/details.aspx?id=14431). [More details here](http://stackoverflow.com/questions/1582844/vcredist-x86-dll-and-version-8-0-50727-4053). – arx Sep 20 '12 at 15:08
  • @arx Thanks! The link you gave me works! Could you post is as an answer, so I can accept it? – sashoalm Sep 21 '12 at 08:06
  • Did you try copying vcomp80.dll? It would be nice to avoid having to install redistributable packages – ds-bos-msk Jul 31 '14 at 07:35

2 Answers2

1

You need to install the Microsoft Visual C++ 2005 redistributable.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
1

You need to install a redistributable package for VS2005. Unfortunately, there are several of them for different service pack levels, security fixes and so on.

In general, to find the one you want Google the version number of the DLL that isn't loading (8.0.50727.4053 in this case).

You'll probably find a link to the right package.

arx
  • 16,686
  • 2
  • 44
  • 61