Search code examples
c#asp.netdllsql-server-ceasp.net-4.5

System.Data.SqlServerCe. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)


I have created a web project which uses sql compact but when I run this project, It gives me below error. enter image description here

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

But When I check below option to run it with 64 bit version, It works fine. enter image description here However I have other .Net Websites(Not Projects) which run fine without these settings and they also consume same dlls. Perhaps I am missing a lot here.


Solution

  • Force your web app to 32 bit, and follow the simple deployment steps here: http://erikej.blogspot.se/2013/10/sql-server-compact-4-desktop-app-with.html