sapbucket
sapbucket

Reputation: 7195

Script error while nuget install of System.Data.Sqlite

steps to reproduce: Using VS2012 ultimate (I'm sure any version will also work) create a class library project and right click on references and manage nuget packages. Using the nuget package manager, attempt to install System.Data.Sqlite (latest version as of 10.21.2015).

I get the following error message:

Attempting to resolve dependency 'System.Data.SQLite.Core (≥ 1.0.98.1)'.
Attempting to resolve dependency 'System.Data.SQLite.Linq (≥ 1.0.98.1)'.
Attempting to resolve dependency 'System.Data.SQLite.EF6 (≥ 1.0.98.1)'.
Attempting to resolve dependency 'EntityFramework (≥ 6.0.0.0)'.
Installing 'System.Data.SQLite.Core 1.0.98.1'.
Successfully installed 'System.Data.SQLite.Core 1.0.98.1'.
Installing 'System.Data.SQLite.Linq 1.0.98.1'.
Successfully installed 'System.Data.SQLite.Linq 1.0.98.1'.
Installing 'EntityFramework 6.0.0'.
Successfully installed 'EntityFramework 6.0.0'.
Executing script file 'C:\Users\Thomas\Desktop\Active Projects\Contest\packages\EntityFramework.6.0.0\tools\init.ps1'.
Installing 'System.Data.SQLite.EF6 1.0.98.1'.
Successfully installed 'System.Data.SQLite.EF6 1.0.98.1'.
Installing 'System.Data.SQLite 1.0.98.1'.
Successfully installed 'System.Data.SQLite 1.0.98.1'.
Adding 'System.Data.SQLite.Core 1.0.98.1' to Contest.
Uninstalling 'System.Data.SQLite.Core 1.0.98.1'.
Successfully uninstalled 'System.Data.SQLite.Core 1.0.98.1'.
Install failed. Rolling back...
The result "" of evaluating the value "$(BuildTaskAssembly)" of the "AssemblyName" attribute in element <UsingTask> is not valid.  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets

Of course, if I installed just the 'core' package it works. I don't understand why I can't install the official 'full' package.

enter image description here

Upvotes: 2

Views: 3926

Answers (1)

Spaceman
Spaceman

Reputation: 1339

Looking here.

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

There doesn't seem to be an official release for 4.5.2

However looking at the FAQ it states. (http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q3)

(3) What versions of .NET Framework are supported?

The .NET Framework 2.0 SP2 (or higher) for the System.Data.SQLite assembly.
The .NET Framework 3.5 SP1 (or higher) for the System.Data.SQLite.Linq assembly.
The .NET Framework 4.0 (or higher) for the System.Data.SQLite.EF6 assembly.
All sub-projects are fully supported with the .NET Framework 4.0.
All sub-projects are fully supported with the .NET Framework 4.5.

Which is odd perhaps they have just mucked up does using 4.5.1 or 4.5.0 work?

------- UPDATE 1 -------

So I decided to do more digging changing .net did not help me. Manually installing it i got it to work with a bit of difficulty.

So step 1 Go here and get one of the versions. http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki I got the 64bit, 4.5.1 version.

Step 2 install Step 3 open up vs and add the following: (they will be C:\Program Files\System.Data.SQLite\2013\bin if you didn't change the install settings)

"SQLite.Designer.dll" 
"SQLite.Interop.dll" 
"System.Data.SQLite.dll" 
"System.Data.SQLite.EF6.dll" 
"System.Data.SQLite.Linq.dll" 

If you get some grief with SQLite.Interop.dll see Unable to load DLL 'SQLite.Interop.dll'

I just manually copied it into my bin folder.

Then I could run the following.

SQLiteConnection.CreateFile("MyDatabase.sqlite");

var m_dbConnection = new SQLiteConnection("Data Source=MyDatabase.sqlite;Version=3;");
m_dbConnection.Open();

string sql = "create table highscores (name varchar(20), score int)";

SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
command.ExecuteNonQuery();

sql = "insert into highscores (name, score) values ('Me', 9001)";

command = new SQLiteCommand(sql, m_dbConnection);
command.ExecuteNonQuery();

m_dbConnection.Close();

Which I found here Create SQLite Database and table

Hope this helps :).

Tldr Version: it looks like the nugget is outta date. Manually install it:)

Upvotes: 2

Related Questions