Windows 10 C# App will not run says CLRWrapper missing dependencies

1

I have a WPF application that runs fine on a Windows 10 x 64 development machine and a basic Windows 10 x64 VM. When put on a customer machine get an exception saying:

DispatcherUnhandledEvent: Could not load file or assembly 'CLRWrapper.dll' or one of its dependencies. The specified module could not be found.

A dependency walk shows the following dependencies:

  • VCRUNTIME140D.DLL

  • ucrtbased.dll

  • MSVCP140D.dll As missing. Placing anyone of those DLLs into System32, SysWOW64 or in the root folder for the application results in the following error:

    Could not load file or assembly 'CLRWrapper.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Why is this causing this error? The application did not run in the VM until I placed these DLLs into the System32 and SysWOW64 folders.

Anybody have any ideas?

TIA, Doug

windows
c#-4.0
windows-10-desktop
asked on Stack Overflow Aug 19, 2020 by AeroClassics

1 Answer

0

@Nandosytle, I was trying to run as a 64-bit application. As 64-bit it ran fine on my development system and my build server. Moving the various debug versions of the Windows dlls made it run in the VM. To get it to run on the target machine, I have to recompile the CLRWrapper and the code it was wrapping as x86 and change the C# application to x86. Once that was done the application runs fine on the target machine.

Still not quite why this made things better. The complaints were odd asking for debug versions of the files. I guess it came down to the C++ being debug and the C# being Release. Though that really should not have mattered.

Still a headscratcher.

Doug

answered on Stack Overflow Aug 24, 2020 by AeroClassics

User contributions licensed under CC BY-SA 3.0