Click here to Skip to main content
Click here to Skip to main content

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

By , 20 Feb 2013
Rate this:
Please Sign up or sign in to vote.

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)

About the Author

Noor Ahmad Feroozi
Software Developer (Senior) Ministry of Education
Afghanistan Afghanistan
Over eight years of IT industry experience, and have been a part of design and development projects for many exceptional companies during those years, including Kabul Cyber Park, Alpha Omega Services, Ministry of Defense, Spacetech ICT Solutions, Ministry of Education and many others.
 
Technologies I use are standards-based XHTML, CSS, JavaScript, jQuery, PHP, ASP.Net, C#.Net, MS SQL, MySQL and SQLite. Each project I develop is built to be search engine and user friendly, using the latest development principles and techniques. To find out more about what I can do for you, check out my work at http://recentsolutions.net, or get follow me on http://twitter/naferoozi
Follow on   Twitter   Google+

Comments and Discussions

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