EntityFramework.Exceptions
EntityFramework.Exceptions copied to clipboard
Duplicate sqlite dll on build
Hi Im creating a new project and want to use this library. Im trying to use a password protected SQlite DB. For this I should reference microsoft.entityframeworkcore.sqlite.core because it dont have an sqlite dll embeded and use sqlitepclraw.bundle_e_sqlcipher wich support encrypted DB.
The issue is that EntityFramework.Exceptions have an internal dependency in microsoft.data.sqlite without core and the result build contains both sqlite versions.
The result buid:
With EntityFramework.Exceptions contains e_sqlcipher.dll and e_sqlite3.dll
Without EntityFramework.Exceptions, only e_sqlcipher.dll
Any workaround is welcome.
Thanks in advance.
Is simply deleting e_sqlite3.dll from the bin directory enough? If yes you could add a post build step as a workaround.
Well Im not shure if deleting e_sqlite3.dll from the bin directory is enough. I will do some tests later.
About the post build. I check an there are several files that should be deleted. Im doing this
and seems to work during a normal build
but fails when publishing single file (and Aot) using console
Im not really good with build tooling, any help is welcome.
I, sorry for the late answer. I check and droping e_sqlite3.dll manually solve the problem and some basic testing shows the app only using the e_sqlcipher.dll. Is yet to test if trimming remove the unneeded dll or not. Just need to find a way to remove before single file generation.
@alex6dj Is this still an issue?
Hello. Yes, I still think it is a problem yet. Not directly now, but in the future. For now I am removing the extra dlls using the command I published in the previous post, but in the long run the idea is to publish the app using NativeAOT and by not removing the dlls it will increase the final size of the application unnecessarily. Apart from this, by eliminating the unnecessary dlls the application works correctly.
I added a new package https://www.nuget.org/packages/EntityFrameworkCore.Exceptions.Sqlite.Core that depends on Microsoft.Data.Sqlite.Core instead of Microsoft.Data.Sqlite