How I make a single-executable with System.Data.SQLite merge?
c#, sqlite, wpf
Solution
for the `System.Data.SQLite.dll` assembly you can embed it as a resource and then use `Reflection.Load` from the resource before it's used by any of your code so it's ready to go. Or handle when `AssemblyResolve` is called, then you load it from the resource.
With the `SQLite.Interop.dll` thats the hard part because it actually makes all the calls to the SQLLite C++ libraries, and the method used by the `System.Data.SQLite` assembly makes calls to the correct DLL based on X86 or x64. You could possibly couple the 1st part of this with this article to create a memory based load of the 2nd DLL but you'd need to replicate the initial checks for x64/x86 and .NET dll performs and then load the correct one. (You'd just embed both and load the correct one)
Problem
My application includes `SQLite.dll`. How I make a single-executable application in C# WPF without installing via ClickOnce Application or any installation file setup. How can I bundle `System.Data.SQLite` into my project so I can produce a single-executable application with no tag-along DLLs?