2

I have a mixed-mode DLL built in visual studio 2005. In dependency walker, my DLL is showing a dependency of the following CRT Dlls. Note this is on my Windows 7 developement machine.

c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\MSVCP80.DLL

"\MSVCR80.DLL

"\MSVCM80.DLL

8.0.50727.4927

On my Windows 7 dev machine using Visual Studio 2005 this compiles and runs just fine. the problem is it wont run on my Windows XP test machine with the latest CRT installed.

When I drag the DLL into depenency walker on the XP machine it seems to be searching for the DLLs in \System32... (I went to show full path and there was no paths for them, just a yellow exclamation mark)

The problem is that this version (build 4927) of the crt in WinSxS is not installed on the XP test machine. it has Visual Studio 2005 with the latest CRT installed (sp1?).

8.0.50727.4053 is the latest version I could find on MSDN.

I realize this is not the most exciting question posted on SO, but does anyone know what is up with this 4927 runtime?

* EDIT *

The manifest generated by MT.exe:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

So, there is 3 different versions it is targeting...

starblue
  • 55,348
  • 14
  • 97
  • 151
Tom Fobear
  • 6,729
  • 7
  • 42
  • 74

1 Answers1

1

Revision 4927 is a Windows 7 specific version, probably used by Microsoft binaries. Your build should not create a dependency on it, 4053 is the last one for VS2005. Don't troubleshoot this with depends.exe btw, it isn't good at tracking winsxs dependencies.

Start troubleshooting this by double-checking what dependency your build generates. First look in vc\include\crtassem.h, the _CRT_ASSEMBLY_VERSION macro generates the manifest entry. Next is to check the manifest that's embedded in your executable. Your project's Release directory contains the .embed.manifest file that was embedded. And File + Open + File on your executable lets you peek at the actual embedded RT_MANIFEST resource.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • the version in _CRT_ASSEMBLY_VERSION macro is revision 4053 for me, which the XP machine has. There is a mydll.dll.manifest in my output folder, when i open it it says 8.0.50608.0 (RTM?). I did not find an embed.manifest in my solution directory. can you elaberate on the File + Open + File part? I looked at the manifest in ILDasm and it says ".module extern MSVCR80.dll" and ".assembly extern Microsoft.VisualC { ver 8:0:0:0 }".. i am assuming this is a "Managed" manifest and this RT_MANIFEST section is some sort of embedded PE thing? I am probably wrong, please educate me =) – Tom Fobear Nov 16 '10 at 17:01
  • If ildasm.exe works then this is actually a managed DLL. Are you #including any CRT headers in the C++/CLI code? If you don't then at least include crtdefs.h to get the proper manifest. – Hans Passant Nov 16 '10 at 17:13
  • You can also use ManifestView (http://weblogs.asp.net/kennykerr/archive/2007/07/10/manifest-view-1-0.aspx) to pull the manifest out of a DLL or executable. – Soo Wei Tan Nov 16 '10 at 18:08