1

My Unmanaged VC++ MFC (No .NET used, No CLR support, Use MFC in shared DLL) application trying to deploy with visual C++ runtime files as private assemblies.

It is properly running on windows 7 fresh installed computer. But I gives “This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.” error in fresh installed wondows XP sp3 computer.

I checked in application event logs. But there also no more details, just showing the same error.

Then I read these threads and surf around the internet.

Thread - 1 Thread - 2 Article -1

But couldn't find any solution clue or trouble shooting method. so here looking for some assist.

Community
  • 1
  • 1
Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147

1 Answers1

1

The easiest way to test is to install depends on the computer. Most likely, your application is built to use a later version of C++ runtime libraries, e.g. <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />, but on the XP system it is an older version.

You would need to check what version of the runtime library used by analysing the program's manifest. Then check what depends is showing.

If the required version of runtime is missing, distribute it with the program's install.

On the side note, you could consider switching to the static link. The size of the binaries will be bigger, but these type of problems will be gone

cha
  • 10,301
  • 1
  • 18
  • 26
  • Actually previously I already tried static linking but my application include with number of DLLs and LIBs previded by third party. So static linking mostly conflicting the final build with multiple run-time versions. Secondly compile computer CRT version is `9.0.30729.1` and I defined `_BIND_TO_CURRENT_VCLIBS_VERSION=1` to use it while compiling. When I profile my app in windows XP computer it shows this error `GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR90.DLL" at address 0x78543ACC and returned NULL. Error: The specified procedure could not be found (127). ` – Nayana Adassuriya Feb 21 '13 at 04:01
  • Thank you for your reply. I guess one of DLL that provide by third party may use some other version of `MSVCR90.DLL` so Is there any way to find it? And for your information this App not suppose to use the C++ run time assemblies exist in Win XP computer. That's why I'm deploy all the necessary assemblies with visual C++ runtime files as private assemblies – Nayana Adassuriya Feb 21 '13 at 04:09
  • just open the third party dll with visual studio (yes you can do it). Open resource->RT_Manifest, and see what it is linked with. Then distribute the crt. Depends would show this as well – cha Feb 21 '13 at 04:20
  • thank you for the idea. I found libeay32.dll using older version of CRT `9.0.21022.8` but I can only deploy one version of assembly set in my application directory. Any idea how to fix? – Nayana Adassuriya Feb 21 '13 at 04:36
  • are you sure you are distributing all the assemblies? Try to download the vs_redist from the MS website. The winsxs mechanism of Windows OS is supposed to redirect the entries from the older version to the newer version by itself – cha Feb 21 '13 at 04:44
  • :actually Issue was each DLLs uses different run-time assemblies versions. so I force to compile DLLs with same version by defining `_BIND_TO_CURRENT_VCLIBS_VERSION=0`. Anyway I marked your answer is correct because it will help others to get some clue. thank you gentlemen. – Nayana Adassuriya Mar 05 '13 at 03:19