0

let's say that DLL A as the CRT 8.0.50727.762 as dependency. This DLL is used in a exe project that is linked dynamically (/MD) with "Use Of MFC" = "Use Standard Windows Libraries". Both the DLL and the project using the DLL are using VS 2005, yet the project building machine has a newer CRT. So the exe itself has a dependency to 8.0.50727.6195 in its manifest.

Now I have two question:

  • Is my understanding correct that the CRT versions are backwards compatible?

  • So when I deploy the project and add the CRT assemblies version 8.0.50727.6195 to the exe's working directory it should work on any client no matter what is in his WinSXS cache right?

Matt
  • 14,906
  • 27
  • 99
  • 149
joste
  • 77
  • 1
  • 7
  • 1
    A DLL cannot affect the manifest of the EXE, it has its own. You have more than one version of the CRT in your process, that's quite risky. The DLL's interface has to be very clean, not exchange objects that need to be deleted by the caller, not throw exceptions, not rely on global CRT state like *errno*, etc. – Hans Passant Nov 05 '14 at 13:16
  • But shouldn't the DLL's request for the older CRT be redirected to the newer one (the one of the exe)? – joste Nov 06 '14 at 07:28
  • 1
    That's wishful thinking, it doesn't work that way. – Hans Passant Nov 06 '14 at 10:55

1 Answers1

0

No. CRT or MFC is not backward compatible. You must install appropriate Visual C++ Runtime on client's machine, ensuring that:

  • The version should match (VC7, VC8,.. VC14 etc.)
  • The bit-ness should match. If your application is 32-bit, you need 32-bit redistributable, and same for x64.
  • The service pack version must also match!

It should be noted that all of them can co-exist! VC10 RTM, VC10 SP2, VC10 x64 RTM.. all can co-exist.

Ajay
  • 18,086
  • 12
  • 59
  • 105