Friday, November 5, 2010

The mystery of the C++ redistributable

Have you ever got a cryptic error like this when you try and run an application : “Activation context generation failed for "C:\Users\administrator.UC\Desktop\DHCPUtil.exe". Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.4148" could not be found. Please use sxstrace.exe for detailed diagnosis” ?
What that basically says is that the Visual C++ runtime (C++ 2008 SP1 x64 to be precise) was not found on your system. Now there is a whole lot of details out there about side by side configuration and how apps are compiled and how windows searches for the runtime. But basically you just need to know what version you need and where to download the latest version right?
Another point of note is that within each family (2005, 2008, 2010 etc) there have been service packs and updates, each time there is an update Side By Side(winsxs) adds policies in your system to make sure the latest version is always used.
Latest VersionDescriptionDownload link
8.0.50727.4053Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update http://www.microsoft.com/downloads/en/details.aspx?FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2
9.0.30729.4148Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2051a0c1-c9b5-4b0a-a8f5-770a549fd78c
10.0.30319.1Microsoft Visual C++ 2010 Redistributable Package (x64) http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bd512d9e-43c8-4655-81bf-9350143d5867
10.0.30319.1Microsoft Visual C++ 2010 Redistributable Package (x86)http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84

And the answer to ‘how do I know what version I have?’ – well the easiest thing is to look in ‘add/remove programs’ or ‘Programs and Features’. This will tell you which redistributables have been installed.
However If you want to know exactly what’s installed and what sxs is up to go to %windir%\winsxs\manifests\ and search for the policy file relating to the version you are having trouble with. The files are named processorArchitecture_policy.majorversion.name.publickeytoken_version. For example amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest 

No comments:

Post a Comment