C++ dll loading failed with incorrect format exception when VS is not installed

169 views Asked by At

I have an unmanaged C++ code which compiled to a C++ dll and is called from a C# application. In the C++ code I user /clr to compile the dll, and I have a wrapper to all functions, so the C# app works fine with the dll. When trying to run the C# application on a computer without Visual Studio installed I get the following error:

"an attemp was made to load a program with an incorrect format. Exception from HRESULT: 0x8007000B

And then the application crashes. I've tried to change the Runtime Library to multi-threaded (/MT) but it didn't help. .NET framework with the needed version is installed on the computer. And the .NET version of the C# application is 4.5, as the version of the dll. Any suggestion what can help to solve this issue?

0

There are 0 answers