Tech Off Post

Single Post Permalink

View Thread: Side-by-side screwup
  • User profile image

    I've ran into this issue a couple times, the first time I overcame it I didn't fully understand why - but now I have a solution I feel I should share.

    I have VS 2005 on my desktop here at work, and I installed VS 2005 SP1 Beta on my work laptop to try it out. Software compiled on my laptop will give the 14001 SxS error that we have all been struggling with on my desktop (and all the other computers I tried to deploy on).

    A valid solution is creating an msi installer with merge modules for MFC and the CRT included, but that is not practical for testing and deploying small apps. Also, if you are installing at a customer site, you don't want to install new SxS policies and manifests that could break other 3rd party apps that the customer depends on. I don't recommend manually messing with the WinSxS directory, as some have had success with. If you copy dll directories only, and not policies and manifests, you can really screw things up. Also, don't just dump tons of DLLs into your System32 folder, another good way to mess things up. Merge modules are cleaner, but have some dev overhead and leave a global footprint. (A policy file will re-route any app asking for an old version of a dll to the newest version. Not good if some other app is not validated with the latest dlls yet.)

    I like to drop dlls that my app depends on into the same folder I drop my app into. The trick is to know which dlls your app was compiled with. VS 2005 and the Beta SP1 have different versions of MFC and CRT. Browse to:
    C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86
    Here you will find folders of what you are looking for, little groups of dlls and manifest files to go along. Just copy all the contents into the local path of the exe you are deploying.
    (Most people only see an x86 folder here, but some have AMD x64 and Intel x64 folders for those compile options.)
    You'll notice that Debug dlls are NOT redistributable.
    This local copy also makes uninstalling much easier. Just delete them!

    I was guided by this article, which today apparently does not exist in English, but hopefully MSDN will fix it before anyone clicks on it:">

    You can either copy these files manually in a debugging deployment scenario, or add post-build events to copy from your actual Visual Studio 8 folder (use $(Configuration) macro for Debug/Release switch), or add these files to a Setup project.