문제

I have the following lines of code:

IDbConnection dbConn = dbFactory.OpenDbConnection();
IDbCommand dbCmd = dbConn.CreateCommand();

I am getting the following exception:

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

I thought this might have to do with 32 bit and 64 bit applications, so I tried both versions of the dll. In addition, I also enabled 32 bit applications through IIS. Can someone tell me why I may be getting this error?

도움이 되었습니까?

해결책

Right, this is a result of trying to use a 32bit unamanged dll (Sqlite) on a 64bit pc.

See this answer for solutions.

Otherwise use a platform-specific Sqlite .NET wrapper:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top