C# Missing MSVCR100.dll
Asked Answered
D

4

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?

Drift answered 5/8, 2011 at 13:5 Comment(3)
Where is the file located now? It should be located in the folder with the other application.Petitioner
Please not ship software that copies DLLs into windows\system folders. That just creates DLL Hell possibilities. See my answer below.Scevor
Can you execute the app normally?Chromatid
S
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.

Scevor answered 5/8, 2011 at 23:36 Comment(8)
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?Drift
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).Scevor
Internal testers using a DEBUG build should just find some workaround to copy over msvcrt100d.dll.Scevor
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?Drift
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.Scevor
I'm testing your solution. I check this answer as right when my tester approve it. Thanks thanks thanks for your help.Drift
Is it possible to install both on the same computer?Birdwell
@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.Scevor
R
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.

Ragout answered 5/8, 2011 at 13:9 Comment(0)
G
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.

Gregory answered 5/8, 2011 at 13:7 Comment(7)
ah yes, now I remember a recent issue I had where this was the fix... good call :)Susurrus
Exactly. How can I verify if the client machines has the proper runtime installed?Drift
if you create a setup project for your program you can include the Visual C++ Runtime in the prerequisites ;-)Gregory
Thanks for your help, but my app shouldn't start with a setup. Only with a single click on exe file.Drift
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 ;-) )??Gregory
But if I install separately this package: microsoft.com/download/en/details.aspx?id=14632 my app should works?Drift
@Cecco let us continue this discussion in chatGregory
S
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

Susurrus answered 5/8, 2011 at 13:8 Comment(6)
No, you can't, it is not legal to do it that way.Underbody
@leppie, shipping or registering?Susurrus
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.Underbody
@leppie, this article (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!Susurrus
You have them install the Visual C++ runtime dist package.Petitioner
I read something in dranaxum.wordpress.com/2008/02/25/…, could works?Drift

© 2022 - 2024 — McMap. All rights reserved.