Hi

I am trying to put up a little program using System.data.SQLite with C# under 
Visual Studio 2017. The Target Framework is dotnet core 2.0
I imported the nuget Package (Project - manage nuget Package ...) into the 
Project.
The compilation works fine. But if running the compiled program I get an error: 
System.IO.FileNotFoundException: "Could not load file or assembly 
'System.Data.SQLite, Version=1.0.109.0, Culture=neutral, 
PublicKeyToken=db937bc2d44ff139'. Das System kann die angegebene Datei nicht 
finden."

The used code is very simple:

private string getID(string pfad)
        {
            SQLiteConnection sqlite_conn = new SQLiteConnection("Data 
Source="+pfad+";Password="+sqlitepwd+";");
            sqlite_conn.Open();
            SQLiteCommand sqlite_cmd = sqlite_conn.CreateCommand();
            sqlite_cmd.CommandText = "SELECT ID FROM IDList";
            string id = (string)sqlite_cmd.ExecuteScalar();
            sqlite_conn.Close();
            return id;
            }
The error message is created when calling the function ...

If I ladd the nuget package "System.Data.SQLite.x64" to the project the code 
runs up to the line
SQLiteCommand sqlite_cmd = sqlite_conn.CreateCommand();

The exception "System.AccessViolationException: "Attempted to read or write 
protected memory. This is often an indication that other memory is corrupt."" 
Is triggerd.

There seems to be no Problem when compiling againt .Net Framework 4.6.2. If I 
understand the Version history correctly  it should work with dotnet core 2, or 
am I wrong with that?
Does anybody have an idea what's wrong here?

Regards
Bernd

Bernd Schuhmacher
Development Department

CRANIMAX GmbH, Amerikastrasse 14, 66482 Zweibr?cken, Germany

T +49 6332 90 74 125
bernd.schuhmac...@cranimax.com<mailto:bernd.schuhmac...@cranimax.com>

Please consider the impact on the environment before printing this e-mail.

Pflichtangaben/Mandatory Disclosure Statements:
http://www.cranimax.com/de/impressum
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to