“MSVCP100.dll is either not designed to run on Windows or it contains an error”

22,752

That's STATUS_INVALID_IMAGE_FORMAT, the Machine property in the DLL header doesn't match the architecture of the application.

Do keep in mind that you are likely to have two copies of this DLL on your build machine, the x86 and the x64 version. Later versions of VS have a 3rd copy, the ARM version. So very high odds that you picked the wrong one. Usually you'd target x86, the one you tested your program with is stored in the c:\windows\syswow64 directory. The 64-bit version is in c:\windows\system32.

How these directories got these seemingly backward names is a story for another day :) Favor using the vc/redist subdirectory of the VS install directory as a source for the copy, it is less ambiguous.

Share:
22,752

Related videos on Youtube

bdesham
Author by

bdesham

I’m a software developer by day and I do some programming in my spare time too. I enjoy photography, cooking, and reading.

Updated on May 31, 2020

Comments

  • bdesham
    bdesham almost 4 years

    I built an application in C++ using Visual Studio 2010 Express. When I tried to run it on a certain computer today I got this error:

    MyApplication.exe - Bad Image

    C:\Path to My Application\MSVCP100.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.

    The DLL mentioned is one of the Visual C++ Redistributable DLLs. My application’s installer used to launch Microsoft’s installer for those DLLs but I recently tweaked it just to install msvcp100.dll and msvcr100.dll alongside my application. The new way worked fine on a handful of other computers, though I can’t rule out the possibility that that was only because the DLLs had already been installed at system level on those other computers.

    What is causing this sudden DLL mismatch?

  • bdesham
    bdesham over 9 years
    You’re right. Using the DLLs from C:\Windows\SysWOW64 got the application to work.
  • bdesham
    bdesham over 5 years
    Welcome to Stack Overflow! Downloading Microsoft DLLs from a source other than Microsoft is not a great practice, in general. Can you edit your answer to point to an official Microsoft source instead?
  • bdesham
    bdesham almost 5 years
    Welcome to Stack Overflow! Downloading Microsoft DLLs from a source other than Microsoft is not a great practice, in general. Can you edit your answer to point to an official Microsoft source instead?