21

I'm developing an app that execute another app and I received this error:

the program can't start because MSVCR100.dll is missing from your computer

with my C# app, can I fix this problem copying this .dll into windows/system32 folder? Or exists another method to do this?

KarSho
  • 5,699
  • 13
  • 45
  • 78
CeccoCQ
  • 3,746
  • 12
  • 50
  • 81

4 Answers4

32

This links below point to the proper downloads for the MSVCRT100 installer. This is likely what you want your customers to run before installing your app. This will properly install the MSVCRT DLLs in the proper directory such that all applications can use it.

Microsoft Visual C++ 2010 Redistributable Package (x86) (probably what you need for 32-bit and 64-bit os)

Microsoft Visual C++ 2010 Redistributable Package (x64) (Only if your app itself is 64-bit)

If you actually want to install the MSVCRT100 DLLs through a merge module within your own MSI - you can link your MSI to the MSMs that are located in the x86 version your "c:\program files\common files\merge modules" directory" (Assuming you have Visual Studio 2010 installed).

C:\Program Files (x86)\Common Files\Merge Modules>dir *CRT*.msm
 Volume in drive C has no label.
 Volume Serial Number is 60A4-1718

 Directory of C:\Program Files (x86)\Common Files\Merge Modules

04/22/2011  01:18 PM           584,192 Microsoft_VC100_CRT_x64.msm
04/22/2011  01:41 PM           571,904 Microsoft_VC100_CRT_x86.msm  <-- This is likely the MSM you want if your app is 32-bit.
04/22/2011  01:14 PM           847,360 Microsoft_VC100_DebugCRT_x64.msm
04/22/2011  01:39 PM           801,792 Microsoft_VC100_DebugCRT_x86.msm

Two other alternatives: Instead of copying MSVCRT100.dll into a system directory, copy it into the directory of the EXE app you are trying to launch that depends on this DLL. This isn't recommended, but won't run the risk of breaking other apps.

Another alternative. If you actually have the source code to the EXE that you are trying to launch, you can completely bypass all of this "install msvcrt100.dll" noise by just statically linking to it. In visual studio, it's the option in the project's propery dialog under C/C++ (under the Code Generation tab). Change "runtime library" from "Multi-threaded Dll" to just "Multi-threaded". This adds the /MT compiler switch.

selbie
  • 100,020
  • 15
  • 103
  • 173
  • Thank you for your help. Now I've attached EXEs file (Microsoft Visual C++ 2010 Redistributable Package (x86) and Microsoft Visual C++ 2010 Redistributable Package (x64)) to my code and I've installed the latter. Now error is "msvcrt100D.dll", maybe I've wrong and I should install x86 version? – CeccoCQ Aug 07 '11 at 08:07
  • msvcrt100D.dll is the DEBUG version of the C-Runtime. You aren't distributing debug builds to your customers are you? There is no redistributable package for the Debug runtime. You get the Debug runtime by either installing Visual Studio on the target machine, manually copying msvcrt100d.dll to the directory of the EXE, or building your own MSI package using the Microsoft_VC100_DebugCRT_*.msm files listed above. So in practice, you give your customers (users) RETAIL bits (change your visual studio project configuration and rebuild). – selbie Aug 07 '11 at 08:27
  • Internal testers using a DEBUG build should just find some workaround to copy over msvcrt100d.dll. – selbie Aug 07 '11 at 08:32
  • Ok, I've understand. So, if I distribute the exe file (Microsoft Visual C++ 2010 Redistributable Package (x86 or x64)) and my users install it then there aren't problem with msvcrt100 dll with release version of my app, isn't it? – CeccoCQ Aug 07 '11 at 10:38
  • Right. The "release" version of your project is what you give your users alongside the VC Redist package. Or just use static linking as I describe above and not have to worry about the msvcrt*.dll dependency at all. – selbie Aug 07 '11 at 19:30
  • I'm testing your solution. I check this answer as right when my tester approve it. Thanks thanks thanks for your help. – CeccoCQ Aug 08 '11 at 09:40
  • Is it possible to install both on the same computer? – Jay Sullivan Feb 05 '15 at 20:47
  • @notfed - Yes. Absolutely you can. On 64-bit OS, you can install any flavor of debug, retail, x86, or x64 CRT side-by-side. On 32-OS you can install both debug and retail x86 CRT. – selbie Feb 06 '15 at 02:19
5

Whatever program you're trying to start has to be properly installed first. Msvcr100.dll is one of the DLLs that need to be deployed for programs written in C or C++ with VS2010. It is simple with a Setup and Deployment project or by building the program with the /MT option. Contact the program owner for support.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
2

what is missing is the Visual C++ runtime.

are you starting a C++ application from your C# code? if so, make sure the proper runtime is available on the client machines.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • ah yes, now I remember a recent issue I had where this was the fix... good call :) – musefan Aug 05 '11 at 13:09
  • Exactly. How can I verify if the client machines has the proper runtime installed? – CeccoCQ Aug 05 '11 at 13:15
  • if you create a setup project for your program you can include the Visual C++ Runtime in the prerequisites ;-) – Davide Piras Aug 05 '11 at 13:16
  • Thanks for your help, but my app shouldn't start with a setup. Only with a single click on exe file. – CeccoCQ Aug 05 '11 at 13:18
  • and how will the exe file reach the final location from which users can do the click ( eventually double and not single, depends on how you configure windows to work ;-) )?? – Davide Piras Aug 05 '11 at 13:19
  • But if I install separately this package: http://www.microsoft.com/download/en/details.aspx?id=14632 my app should works? – CeccoCQ Aug 05 '11 at 13:22
  • @Cecco let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/2160/discussion-between-davide-piras-and-cecco) – Davide Piras Aug 05 '11 at 13:23
1

You should be able to fix this by copying it and registering it (with command line: regsvr32 "DLLNAME") or you can ship it with your executable and it should work

WARNING: Please consult the following article before including the file with your software... http://msdn.microsoft.com/en-us/library/ms235299.aspx

I take no responsibility for your actions

musefan
  • 47,875
  • 21
  • 135
  • 185
  • 1
    No, you can't, it is not legal to do it that way. – leppie Aug 05 '11 at 13:13
  • @leppie, shipping or registering? – musefan Aug 05 '11 at 13:16
  • 1
    Shipping. But I dont think you can't register that dll either :) IIRC there is some readme on how to distribute it via an installer. – leppie Aug 05 '11 at 13:17
  • @leppie, this article (http://msdn.microsoft.com/en-us/library/ms235299.aspx) points me to a list of files I can redistribute. One of which is msvcr100.dll but it appears you have to also ship it with msvcp100.dll too! – musefan Aug 05 '11 at 13:20
  • You have them install the Visual C++ runtime dist package. – Security Hound Aug 05 '11 at 13:37
  • I read something in http://dranaxum.wordpress.com/2008/02/25/dynamic-load-net-dll-files-creating-a-plug-in-system-c/, could works? – CeccoCQ Aug 05 '11 at 13:40