Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

e_sqlite3.dll is being copied to the publish directory #430

Closed
jp2masa opened this issue Sep 16, 2017 · 10 comments
Closed

e_sqlite3.dll is being copied to the publish directory #430

jp2masa opened this issue Sep 16, 2017 · 10 comments

Comments

@jp2masa
Copy link

jp2masa commented Sep 16, 2017

I'm using Microsoft.Data.Sqlite 2.0.0, but e_sqlite3.dll is being copied to the publish directory, causing errors at runtime. This seems to be a regression after #360.

EDIT: It can't be a regression in this repo, but it's probably an external problem. Any idea about what may be causing this? Thanks in advance.

@bricelam
Copy link
Contributor

Does installing SQLitePCLRaw.bundle_green version 1.1.8 fix the issue?

@jp2masa
Copy link
Author

jp2masa commented Sep 19, 2017

No, it's still being copied.

@ericsink
Copy link

What are those "errors at runtime"?

@jp2masa
Copy link
Author

jp2masa commented Sep 19, 2017

Something like "e_sqlite3.dll not found", but removing e_sqlite3.dll from the publish directory works.

@ericsink
Copy link

Can you distill this down to a small project that reproduces the problem?

@jp2masa
Copy link
Author

jp2masa commented Sep 19, 2017

I'll try to do that. This is the error message:

30303570-a50916dc-972e-11e7-8547-df9c2f8b0097

@jp2masa
Copy link
Author

jp2masa commented Sep 19, 2017

The project that uses Microsoft.Data.Sqlite is an MSBuild tasks assembly. I tried to create a repro, but it was not possible, although e_sqlite3.dll is copied to the publish directory. Is e_sqlite3.dll supposed to be copied to the publish output (not inside x86 and x64 folders)?

EDIT: The project is targeting .NET Framework 4.6.2.

@jp2masa
Copy link
Author

jp2masa commented Sep 20, 2017

A more complete log:

An error occurred: System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number()
at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()
at SQLitePCL.raw.SetProvider(ISQLite3Provider imp)
at SQLitePCL.Batteries_V2.Init()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Data.Sqlite.Utilities.BundleInitializer.Initialize()
at Microsoft.Data.Sqlite.SqliteConnection..cctor()
--- End of inner exception stack trace ---
at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)

@jp2masa
Copy link
Author

jp2masa commented Oct 2, 2017

I think that this is the cause of the problem:

I have two projects:

  • Project A (net462), has direct dependency on Microsoft.Data.Sqlite
  • Project B (netstandard2.0), has direct dependency on Microsoft.Data.Sqlite

Project A depends on Project B.
When publishing project A, e_sqlite3.dll from Project B is copied to the publish directory of Project A, and two directories are created (x86 and x64) by the Project A publish itself.

@jp2masa
Copy link
Author

jp2masa commented Oct 12, 2017

I think that I finally solved the problem. e_sqlite3.dll wasn't being deployed in the VSIX, which depends on Microsoft.Data.Sqlite. I had to create an MSBuild "hack" to fix it.

@jp2masa jp2masa closed this as completed Oct 12, 2017
@bricelam bricelam removed their assignment Nov 14, 2017
@bricelam bricelam removed this from the 2.1.0 milestone Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants