Saturday, October 24, 2009

Manifest Hell vs. DLL Hell

I never experienced DLL hell - not really. However, it occurs to me Microsoft have created a new kind of hell, by replacing the System Registry with Manifest files.


I've been avoiding manifest files for quite some time, but tonight was forced to learn [almost] all about them in an effort to debug a faulty manifest file.


Activation context generation failed for "
.Manifest".
Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762"
could not be found. Please use sxstrace.exe for detailed diagnosis.

If you are actually desperate enough to try running the sxstrace.exe tool - then my advice is to forget it! That's a tool for the Microsoft developers only (as far as I can tell). It just spits out page after page of useless crap, which in the end, is basically the same as the error above.


 It turns out, my C++ linker was incorrectly [bug?] creating a reference to an assembly I didn't even have installed on my computer: 'Microsoft.VC80.DebugCRT'
I simply removed the reference... although even that requires a trick. Don't
embed the manifest. Use the external file so you can edit it.



 This part was correct!


<assemblyidentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b">


This part was wrong so I deleted it.



<assemblyidentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50727.762" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b">


I found the following link from Microsoft the most helpful and concise:

http://msdn.microsoft.com/en-us/library/ms235342.aspx