Failed to load assembly with inject-dll

Oct 30, 2015 at 4:22 PM
Edited Oct 30, 2015 at 4:23 PM
I'm trying to use LibZ Container to inject all the DLL files that my project needs into a single executable. Normally I've had no trouble with this, but since I started including the System.SQLite.Data package from nuget I'm now bumping into something.

Here's the command that I run from within the bin/Release folder:
libz inject-dll -assembly MyProgram.exe --include *.dll --move
It is able to inject all but one of the DLL files. I see this error message displayed:
Loading '.\SQLite.Interop.dll'
Failed to load assembly from '.\SQLite.Interop.dll'
Assembly '.\SQLite.Interop.dll' could not be loaded
On the SQLite FAQ page, I saw that there was this question and answer:
Do I need to add an assembly reference to the "sqlite3.dll" or "SQLite.Interop.dll" in my project?
No, because they are not managed assemblies and contain no managed code.
Not sure if that impacts things. But the long and short of it is that this executable will not run properly unless I've got the SQLite.Interop.dll file in the same folder as the executable. Is there any way I can get this packaged in with LibZ so that I only need to copy one file instead of two?
Nov 3, 2015 at 11:19 PM
LibZ can package only .NET (managed) dlls but not native dlls. That's a limitation of .NET P/Invoke mechanism which needs dll to be physically on disk (I'm simplifying it a little bit but this good-enough "approximation"). Nothing can be done (easily).