-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0.5 breaks with .NET Framework 4.8 / Non-SDK-style / Mixed Platforms: Unable to load DLL 'e_sqlite3' #451
Comments
…et framework now uses the dynamic provider again, but now the search possibilities includes WHERE_ADJACENT to catch the case where a RuntimeIdentifier was specified so the right dll ends up adjacent to the other outputs instead of in a runtime/rid subdir. trying to un-break anycpu builds. attempts to fix #444 and #446 and #451
Try 2.0.7-pre20210929171745 ? |
Hi @ericsink, Apologies for my delayed answer. I tried this new version and yes, the problem problem is fixed! To be sure I tested the android solution as well and that one stays working too. If this change accepted should I expect 2.0.7 version in the following days / weeks? Best regards, Jan |
I was experiencing the same issue, after upgrading the problem was solved as well. |
I also want to add some information as well. As an example of our structure, we have a project and its dependents, where one is a test project. Both are targeting .NET Framework 4.8 and .NET 5. It looks something like this: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net48</TargetFrameworks>
<AssemblyName>ProjectUsingSQLCipher</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="5.0.10" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.0.4" />
</ItemGroup>
</Project> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<AssemblyName>ProjectUsingSQLCipher.Test</AssemblyName>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<!-- See https://github.com/dotnet/efcore/issues/19396 why we need to do this for .NET Framework-->
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.0.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ProjectUsingSQLCipher\ProjectUsingSQLCipher.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project> For good measure, the <ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<!-- See https://github.com/dotnet/efcore/issues/19396 why we need to do this for .NET Framework-->
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.0.4" />
</ItemGroup> and it still works on both .NET Framework 4.8 and .NET 5. That is fantastic! I just want to finish with saying thanks for the great work, and I hope that 2.0.7 gets released soon. :-) |
2.0.7 is on nuget.org |
Thank you @ericsink! I can only confirm 2.0.7 works and my project SQLite integration is flawless again :) |
Hello,
I am quite probably creating an issue very related (or even a duplicate?) to #389, #444 or #446. My hope is I will be able to provide some additional info that will try to fix a problem introduced in 2.0.5.
2.0.5 is actually the only thing I am 100% sure about. It connects the above issues and it was the version when I discovered the bug. When I try 2.0.6 issue is still reproducible. If I however rollback to 2.0.4 all is fine. The day I discovered this issue there was no any newer version of Frank Krueger's sqlite-net-pcl, it was on the same 1.7.335 version. My Xamarin based Android project is not affected by the same update. There it runs fine even after 2.0.5 upgrade.
I also figured out how to 'fix it', or work it around better said. Following the error message it is clear that the app cannot locate e_sqlite3.dll. My project is couple of years old and all those years the concrete platform specific e_sqlite3.dll was used from .\runtimes\win-x86\native\ or .\runtimes\win-x64\native\ subfolder. If I manually find the e_sqlite3.dll which I find in this subfolder and copy it 3 levels up in the folder hierarchy, i.e. next to the main executable .exe file the application runs as it used to do before.
To my (not very deep) understanding the 'old' way is the correct intended way. I can compare it for example to WebView2Loader.dll which my project also utilizes and there it is loaded correctly from the above named subfolder.
Platform: The old-fashioned classic .NET 4.8 of the main .exe. My solution has number of Class Libraries built with .NET Standard 2.0 target framework.
OS: Windows 10
Debug, Mixed Platforms (When I try to build for x86, x64 or Any CPU the issue still reproduces)
Please let me know whether I can provide more usable info.
The text was updated successfully, but these errors were encountered: