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

2 comments:

Peter Wilson said...

Just a reminder to myself as to what error originally started this train of thought:

Faulting application Flight Simulator.exe, version 0.0.0.0, time stamp 0x4b2ce4e1, faulting module MSVCP90D.dll, version 6.0.6002.18005, time stamp 0x49e03821, exception code 0xc0000135, fault offset 0x00009eed, process id 0x1dfc, application start time 0x01ca810229210cf0.

Peter Wilson said...

Which then led to the following error:

Activation context generation failed for "D:\\FlightSimulator\trunk\build\vs9\Debug\Flight Simulator.exe.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.