[dotnet core] Could not load file or assembly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[dotnet core] Could not load file or assembly

小旭未来
Hello,I installed "System.Data.SQLite.Core (1.0.109.1)" in my project, but when I using "System.Data.SQLite", it throw an exception.
FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.109.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'.

I installed "1.0.109.1", but it can't find "1.0.109.0". And only "1.0.109.1" can be used at dotnet core.
My project's framework is dotnet core 2.1, I don't know why this happened...

Please let me know if I did something wrong.
Thanks.


Sorry, I'm poor of Engilsh...
_(:3」∠)_
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [dotnet core] Could not load file or assembly

Warren Young
On Aug 23, 2018, at 4:01 AM, 小旭未来 <[hidden email]> wrote:
>
> Hello,I installed "System.Data.SQLite.Core (1.0.109.1)" in my project, but when I using "System.Data.SQLite", it throw an exception.
> FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.109.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139’.

Confirmed.  Problem reproduction steps:

    $ dotnet new console -n x
    $ cd x
    $ dotnet add package System.Data.SQLite.Core
    Edit Program.cs per below
    $ dotnet run

In Program.cs, add "using System.Data.SQLite;” at the top and replace the contents of Main with:

    var db = new SQLiteConnection("Data Source=hello.db");
    var c  = new SQLiteCommand("SELECT 1", db);
    var r  = c.ExecuteScalar();
    db.Close();

The program builds just fine, but it fails at runtime.  It doesn’t fail if you build it without modifying Program.cs to make use of the library first.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users