Distributing dll, but cannot find msvcm90.dll on target computer


  • Hi all:
      I am trying to distribute a dll that was written in VC++. However, the dll does not load correctly in the target computer and I get the infamous "This application has failed to start..." error message. After running FileMon and Dependency Walker I find that it is because the dll cannot load msvcm90.dll. This is odd because another dll that was build on the same dev computer runs fine on the target computer. Running Dependency Walker reveals that the dll that has the problem is not looking anywhere for msvcm90.dll (msvcm90.dll is installed on the target computer)

    Does anyone know how to check or define the Runtime Library path for a .NET build? Thanks so much!
    Tuesday, September 01, 2009 8:15 AM


All replies

  • As you can see in the C Run-Time Libraries overview, the dll is required when you compile with /clr.
    Geert van Horrik - CatenaLogic
    Visit my blog:

    Looking for a way to deploy your updates to all your clients? Try Updater!
    Tuesday, September 01, 2009 8:23 AM
  • The project compiles fine, and runs fine on the computer it compiles on. It''s having problems when I move the dll to another computer, then it can't find msvcm90.dll
    Tuesday, September 01, 2009 8:43 AM
  • Is the .NET framework installed on the system and the Visual Studio 2008 C++ runtime?
    Geert van Horrik - CatenaLogic
    Visit my blog:

    Looking for a way to deploy your updates to all your clients? Try Updater!
    Tuesday, September 01, 2009 8:50 AM
  • .NET framework is installed and the dlls are installed in C:/Windows/WinSxS/x86_Microsoft.VC90.CRT.... 

    Is it possible to distribute .NEt dll to computers that does not have Visual Studio installed? I want to distribute it to several clients and not everyone of them would want to install Visual Studio...
    Tuesday, September 01, 2009 8:54 AM
  • I think the problem may also come from the project was originally built in an older version of Visual Studio? Is there any way to update? Or does it make a difference?
    Tuesday, September 01, 2009 8:55 AM
  • Why not just distrubute your version of msvcm90.dll with your dll?
    Tuesday, September 01, 2009 9:23 AM
  • I tried including msvcm90.dll in the same directory as my dll, but it is still not finding it. Anyway to tell the dll during build exactly where to look for msvcm90.dll?
    Tuesday, September 01, 2009 4:08 PM
  • try put the dll in C:\Windows\System32 however the default location for it is C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375
    Tuesday, September 01, 2009 4:09 PM
  • I just tried putting the msvcm90.dll into C:\Windows\System32 but still didn't work, Dependency Walker shows it not found as well.

    I have C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 with the dll(msvcm90, etc)

    Just created C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375 and put msvcm90.dll in there but still doesn't work :(
    Tuesday, September 01, 2009 4:31 PM
  • Probably because it's not JUST the dll that's needed on the target machine. In the project settings are you using static libraries? If not then that's your problem.
    Tuesday, September 01, 2009 4:33 PM
  • I am using MFC in Shared DLL, when I tried to specify Use MFC in Static Library, I get the error that it is not compatible with /clr ....
    Tuesday, September 01, 2009 4:35 PM
  • I don't think MFC supports .NET that well. Anyway, you have your solution but it's just brought up more unfix-able problems.
    Tuesday, September 01, 2009 4:46 PM
  • What is the solution?
    • Marked as answer by bubol Tuesday, September 01, 2009 4:49 PM
    Tuesday, September 01, 2009 4:47 PM
  • Project -> Properties -> Configuration Properties -> General -> Use MFC -> Use MFC in Static Library
    Tuesday, September 01, 2009 4:49 PM
  • If you do not require the /clr switch, recompile and link statically using the advice of TheNobody. If you must use the /clr switch, then you must link dynamically. In this case, install the Microsoft Visual C++ 2008 SP1 Redistributable Package (assuming you are compiling with VS 2008 SP1).

    There are other ways of deploying C++ executables. For further research, please review the following links:

    How to Deploy C++ Properly
    Deployment (C++)
    How to redistribute the Visual C++ Libraries with your application
    Windows Installer
    Deploying .NET Framework Applications
    Determining Which DLLs to Redistribute
    • Marked as answer by bubol Tuesday, September 01, 2009 5:37 PM
    Tuesday, September 01, 2009 5:05 PM
  • Thanks! the Redistribution Package worked!
    Tuesday, September 01, 2009 5:37 PM