ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
523 stars 109 forks source link

2.0.5 breaks with .NET Framework, non-SDK-style projects #446

Closed m4r10guapito closed 2 years ago

m4r10guapito commented 3 years ago

Hello,

not sure if this issue is related with #444 and/or #445, in any case with version 2.0.4 it works fine while with 2.0.5 I get the following exception when I try to create a new SQLiteConnection

InnerException = {"Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"} Message = "The type initializer for 'SQLite.SQLiteConnection' threw an exception."

I'm using Windows10 and VisualStudio2019

Please tell me if you need more information.

Thanks in advance

-- Mario

ericsink commented 3 years ago

I'm using Windows10 and VisualStudio2019

Yes, please post a minimal repro sample project.

m4r10guapito commented 3 years ago

Here you can find a small program that reproduce the error

https://1drv.ms/u/s!Aut18fzhwlA_j_RP70xXEbnlcQ1euQ?e=XAaxlB

gnimor commented 3 years ago

I can see the same issue here

ericsink commented 3 years ago

Initial findings for @m4r10guapito : That repro sample uses .NET Framework (not .NET Core), old (non-SDK-style) projects, and packages.config (not PackageReference), which is not something I test with. The problem appears to be that the targets file is not copying the DLLs over.

ericsink commented 3 years ago

@gnimor You may be seeing the same issue or you may not. Most "Unable to load DLL" errors look the same, but the underlying causes can be very different.

gnimor commented 3 years ago

@ericsink: I think it is the same issue because I have also a .NET framework project (not the SDK-style) and I am also using the packages.config approach. After reverting back to the 2.0.4 the issue is gone.

m4r10guapito commented 3 years ago

For your information: I migrate my project from packages.config to PackageReference but still the same. 2.0.4 works 2.0.5 not works

ericsink commented 3 years ago

@m4r10guapito That's good to know. Thanks.

ericsink commented 3 years ago

Need to investigate differences between this issue and #444. Do non-SDK style projects work okay with 2.0.5 when NOT building for AnyCPU?

m4r10guapito commented 3 years ago

With x86 or x64 it works. AnyCPU not work

ericsink commented 3 years ago

Ah. So it looks probable that this bug and #444 may be the same thing.

ericsink commented 3 years ago

Try 2.0.7-pre20210929171745 ?

m4r10guapito commented 3 years ago

Just tried and it seems to works fine! I'll continue using it and in case of issue I'll advise you.

Thank you

ericsink commented 2 years ago

Fixed in 2.0.7, now on nuget.org