BadImageFormatException and valid Win32

0

I have a C# application that runs well on my work laptop. However, the same application cannot run on my home laptop, I get an error saying: System.BadImageFormatException HResult=0x800700C1 Message=Could not load file or assembly 'xxx.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Both are Windows 10, both Visual Studio 2017 and have also the same configurations. What might be the issue and solve it?

c#
winapi
console-application
badimageformatexception
asked on Stack Overflow Jul 27, 2019 by Tico • edited Jul 27, 2019 by Tico

1 Answer

1

Make sure 'xxx.dll' and all of its dependencies is the same as your OS architecture(x86/x64). Use dependency walker to find out the dependant modules.

answered on Stack Overflow Jul 31, 2019 by Kamaal

User contributions licensed under CC BY-SA 3.0