Can't get SQLite to work on an MVC6 beta 8 project.
To reproduce the problem, assuming you have beta 8 already installed in Visual Studio 2015:
-
Create a new empty WebApi project
-
In project.json, under
frameworksremovednx5, leaving justdnx451 -
Create an empty
test.datfile in yourwwwrootfolder -
Install latest 1.0.98.1
SQLitewith Nuget:Install-Package System.Data.SQLite -
In
startup.csaddusing System.Data.SQLiteandSystem.IOand put this 2 lines intopublic Startup(...string folder = Directory.GetCurrentDirectory();SQLiteConnection conn = new SQLiteConnection(@"Data Source="+folder+"test.dat");
Hit F5 and you will get Unable to load DLL 'SQLite.Interop.dll'
There are lot of questions and answers about this topic for previous versions of VS... I tried mostly everything including building for x86 and x64, install other nuget packages (Core / PCL / bare SQLite / Entity, etc) and so on. There are some workaround copying files by hand, but I need this to deploy on a server without much intervention.
Its hard to believe that the most used compact database in the world can't work out of the box in VS2015, so I'm hopping that I'm doing something incredibly wrong and someone can shed some light.
Thanks.-
Aucun commentaire:
Enregistrer un commentaire