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
@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
User contributions licensed under CC BY-SA 3.0