What the...?

Something bad happened

We're not sure what, but we have a few guesses.

Problem: Object reference not set to an instance of an object.
Ticket: 7864825
Server: Web02
An attempt was made to load a program with an incorrect format sqlite - CodeProject Click here to Skip to main content
11,715,043 members (70,414 online)
Click here to Skip to main content

Tagged as

An attempt was made to load a program with an incorrect format sqlite

, 20 Feb 2013 CPOL 10.4K 3
Rate this:
Please Sign up or sign in to vote.
An attempt was made to load a program with an incorrect format sqlite

I was loading an ASP.NET small application on IIS7 which used SQLite as back-end and I was getting the error "Could not load file or assembly ‘System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139′ or one of its dependencies. An attempt was made to load a program with an incorrect format.".

Since it was a compiled application and I didn’t have the source code, I was not able to go through the source code and troubleshoot the application. After searching and working for few minutes, I found that the application was developed for 32-bit operating system and I was working on a 64-bit operating system.

Also, I found that System.Data.SQLite.dll is a mixed assembly file and it contains both native and managed code and one System.Data.SQLite.dll file is either 32-bit or 64-bit and it can not be both. And if a 32-bit application runs on IIS7 and/or 64-bit operating system, the same error will occur.

I solve this problem by following steps below:

Step 1

 

Go to IIS7 and open Application Pools

Step 2

Right click on the pool which is associated with website or application in IIS and select Advanced Settings

 

IIS7 Advanced Setting

Step 3

Set "Enabled 32-Bit Application" to True and press OK

IIS7 Advnaced Settings - Enbale 32-Bit Applications
IIS7 Advnaced Settings – Enbale 32-Bit Applications

Step 4

Restart the IIS (Optional) and check the application.

Step 5

I hope above steps solve your problem.

Any comments or suggestion are most welcome.

The post An attempt was made to load a program with an incorrect format sqlite appeared first on Recent Solutions.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Noor Ahmad Feroozi
Software Developer (Senior) Ministry of Education
Afghanistan Afghanistan
No Biography provided

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150901.1 | Last Updated 20 Feb 2013
Article Copyright 2013 by Noor Ahmad Feroozi
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid