An attempt was made to load a program with an incorrect format” even when the platforms are the same

change "Enable 32-Bit Applications" to "TRUE".
Restart your website and it should work.
enter image description here
OR
In Visual Studio, Right Click your project -> On the left pane click the Build tab,
Project properties, build tab
under Platform Target select x86 (or more generally the architecture to match with the library you are linking to)
Project properties, platform target
I hope this helps someone! :)

Comments

Popular posts from this blog

How to use DbFunctions.TruncateTime

Microsoft Access Connectivity from C#

Tool 'dotnet-ef' failed to install. dotnet core