I am new to using Sqllite for my unit tests, and I was getting all bunch of errors, one of the most popular one is :
"System.BadImageFormatException: Could not load file or assembly
'System.Data.SQLite, Version=22.214.171.124, Culture=neutral,
or one of its dependencies. An attempt was made to load a program with
I am using Visual Studio 2010 beta 2, and Nunit for my unit tests; so most of the time I am blaming Visual Studio 2010 beta 2 version for any error I am getting, as it is a beta version!
When I googled it, I found a few different suggestions; but as in most of the Google answers, those suggested solutions work for some people apparently but not for me :). One of the suggestions actually work for me, and it is the reason for this mini blog post. Here is my information about my development environment:
I am using Resharper V5.0 beta,and Visual Studio 2010 beta 2. Apperently Resharper 5.0 is running the unit tests in 32bit mode. And my development environment including the Sqllite is all 64 bits, so I need to use 64 bit version of Nunit, however Resharper is not doing this.
My next step was, I ran Nunit-gui to run my unit tests, and hoped that everything was working for now, and guess what it wasn’t :). This time it was my fault,as I did not run the 64 bit of the Nunit gui. So as a next step this time I ran the Nunit-guiX64.exe and ran my tests, and everything is working fine :)