ross dickinson: web and desktop software developer

TeamCity unable to run unit tests that use NHibernate and SQLite through nuget

by Ross on November 8, 2013 at 4:21 PM under

You may have seen this lovely exception before;

System.Exception: An exception has been encountered in setting up the test SQLite database. 

---> NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.3.1.4000

---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 

---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed..

 This happens due to a limitation in the NuGet command line and TeamCity's usage of it. A very dumb hack we've found to make this work correctly is to put a direct reference to a type in the Sqlite library inside one of the unit test classes. No clue why it works, but it does.

Add comment

biuquote
  • Comment
  • Preview
Loading

About the author

rossisdead is a 26 year old web and desktop software developer from New Jersey. He has two cats and likes long walks on the beach.

On Stackoverflow

On Stackoverflow Careers

On Codeplex

On Github