1
votes

I've been banging my head against the wall trying to fix this compiler warning:

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=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL", "x86".

I have a Web API project that targets Any CPU, and added the System.Data.SQLite Nuget package, which is supposed to support x86 and x64, however when building I'm getting the error message above.

1
Can you try and target x86 instead of Any CPU? If SQLLite contains DLLs that are not .NET DLLs they will be built for either x86 or x64. You can't compile a non .NET dll so it will work for both architectures.mortb
I don't want to target x86, I want to use our 64-bit AppPool on our IIS server. I know that changing the target to x86 will fix the warning, but I'm not trying to run a 32-bit process in IIS. In the Nuget package it says it will work on x64, but I'm still seeing this warning.Jon
Check which SQL dll version is referred in web.config and project filemortb

1 Answers

1
votes

OK I found the answer, my project had a reference to a local System.Data.SQLite.dll in my project folder, even though the SQLite NuGet package was installed. Uninstalling and reinstalling the Nuget package didn't fix the reference. I removed the reference manually, delete the local .dll file and then used NuGet to install the package.

Warning gone!