BadImageFormatException

Hello everyone,

Recently while working on a VB.NET project I had a class library project set to compile for “x86” while my application was still set to compile for “Any CPU”.

When I tried to access my dll it threw me a BadImageFormatException:

At first I didn’t know why it was throwing the error untill I noticed that my application was still set to compile for “Any CPU”.
I changed it to “x86” and after that it worked.

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.