My program is occasionally crashing with the following error message:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.BadImageFormatException: Index not found. (Exception from HRESULT: 0x80131124)
Some details which may be relevant:
My questions are
Thanks very much.
UPDATE
Instead of targeting the EXE for ANY, I forced it to x64. The problem still occurs.
Have a look in your solution configuration to make sure all your projects build to the same platform.
The reason for your error is because you have a x86 file trying to load a 64bit dll or Vice versa.
Hope it helps.
You can change your platform target build to X86
There was a similar error due to a broken one .NET Framework. Restore via the utility .NET Framework Repair Tool solved the problem.
User contributions licensed under CC BY-SA 3.0