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
9.0.30729.4148Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update
10.0.30319.1Microsoft Visual C++ 2010 Redistributable Package (x64)
10.0.30319.1Microsoft Visual C++ 2010 Redistributable Package (x86)

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 For example 

1 comment:

  1. Spent about 1.5hrs looking high and low for the 4148 Redistributable... thanks!