CR95HF.dll won’t load in Windows (8/10) 64-bit – System.BadImageFormatException

This goes for all non-managed DLLs which are 32-bit but have the .NET application loading them compiled with AnyCPU (and not x86).

If this message appears in the Event Viewer : System.BadImageFormatException related to a dll (in this case the CR95HF.dll for NFC) , download the Windows SDK for your Windows version. It will contain CorFlags.exe in \Program Files\Windows SDKs\Windows\v7.1\Bin\.

Simply set the header of the managed .NET .exe to 32bit;

\Program Files\Windows SDKs\Windows\v7.1\Bin\CorFlags.exe /32BIT+ YourApplication.exe

And try to run it again ; it likely will run without any issues!






Comments are closed.