why i don't have Microsoft.VC80.MFC-file?

char m picture char m · Oct 26, 2010 · Viewed 43.7k times · Source

Got a fresh Win7 machine with VS2005 installed. I tried to start a MyApp.exe that is built with manifest that says in Manifest.bin:

...

<assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>

...

and the result was error message "The application has failed to start because it's side-by-side configuration is incorrect...

Event viewer told me the reason in detail:

Activation context generation failed for "c:\Xxx\MyApp.exe". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.

so I browsed the winsxs folder and indeed all "4053-folders" were missing. Then i edited Manifest.bin and replaced 4053 with 4927. The errors reocurred with different version. Then I found out that I got "4927-folder" for msvcr80.dll but no "4927-folder" for mfc80.dll.

Two questions:

-Why no "4927-folder" for mfc80.dll?

-How to get all "4053-folders" ?

Thanks & BR -Matti

Answer

Alexey Ivanov picture Alexey Ivanov · Mar 22, 2011

You should either install Visual C++ redistributable or use merge modules to add the redistributables into your Windows Installer installation package. Or alternatively you should copy MFC libraries in the directory with your application.

Libraries that can be used as private assembly (in your app directory) are located in C:\Program Files (x86)\Microsoft Visual Studio 8\VC\redist\x86, or in amd64 if your app is 64 bit.

Merge modules for Windows Installer (MSI) are in C:\Program Files (x86)\Common Files\Merge Modules.

Redistributable package that installs all the libraries can be found in C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe for 32 bit programs and in …\vcredist_x64\vcredist_x64.exe for 64 bit programs. You can get these files from Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update.


And I think you want to update Visual Studio with this package Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update.