Mismatch between the processor architecture error with SQLite RRS feed

  • Question

  • I am using Visual Studio 2010, and SQLite. I think the version of sqlite is 3.8.2. The version I think I am using for the System.Data.SQLite.dll (this is the .NET dll, I believe) is Whenever I compile I get this warning:

    Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. PrayerRequestLib

    Now, I am on a Windows 7 x64 box here. My project structure is:

    PrayerRequestLib - all the db code for SQLite is here

    PrayerRequests - this is the main app (desktop app in this case)

    At first I used nuget to install SQLite in my project - Install-Package System.Data.SQLite

    I have gone to the Configuration Manager and have tried to change the projects' platform to match x86. Well, I have tried everything and the PrayerRequestLib platform you get a choice of Any CPU or new or edit. I then downloaded the sqlite dlls for .NET directly from SQLite. I installed them on my pc and directed the references to them. None of these efforts made the above warning go away. What do I need to do and should I worry about this. Finally, the platforms that this program will be installed on will likely be x86 and NOT x64. One more thing, I am using C# for the language. Thanks 

    Ed Cohen

    Edgar Cohen

    Wednesday, January 1, 2014 9:56 PM


  • Hi Edgar,

    As Anton in this thread said:


    is a mixed assembly, i.e. it contains both managed code and native code. Therefore a particular System.Data.SQLite.dll is either x86 or x64, but never both.

    You need to choose an appropriate version of SQLite to install on your machine. For example, my machine is Windows 7 Enterprise 64-bit, I installed Visual Studio 2010 on it. So I choose sqlite-netFx40-setup-bundle-x64-2010- from SQLite release site. After I installed it and added reference to System.Data.SQLite.dll under the installation folder, I built my project and the warning came up. I checked the target platform of the project and found that the default platform target is "X86", so I changed it to "X64". Finally it worked fine.

    And here is the whole code snippet:

    private string dataSource = "ContactBookDB.sqlite";
            private void button1_Click(object sender, EventArgs e)
                button1.Text = "DatabaseCreated!";
            private void button2_Click(object sender, EventArgs e)
                SQLiteConnection dbConn = new SQLiteConnection("Data Source=" + dataSource);
                SQLiteCommand dbCmd = dbConn.CreateCommand();
                dbCmd.CommandText = "CREATE TABLE TelephoneBook(personID varchar(20),telephone varchar(30),type varchar(20))";
                dbCmd.CommandText = "INSERT INTO TelephoneBook VALUES('MTB','1234567890','not mobile')";
                dbCmd.CommandText = "SELECT * FROM TelephoneBook";
                SQLiteDataReader dataReader = dbCmd.ExecuteReader();
                DataTable dataTable = new DataTable();
                if (dataReader.HasRows)
                dataGridView1.DataSource = dataTable;
                button2.Text = "TableCreated!";

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 2, 2014 11:34 AM