ILMerge error: SQLite.Interop.dll [Could not load

2019-08-27 04:01发布

I'm currently writing a small app and I decided to use SQLite database. I need 2 libraries to merge with ILMerge: SQLite.Interop.dll and System.Data.SQLite.dll

The problem is when I want to merge my exe with those DLLs.

When I try to merge them, there appears an error: An exception occurred during merging:

ILMerge.Merge: Could not load assembly from the location 'C:\Program Files\Micro
soft\ILMerge\SQLite.Interop.dll'. Skipping and processing rest of arguments.
   w ILMerging.ILMerge.Merge()
   w ILMerging.ILMerge.Main(String[] args)

What's more, when I merge the exe with System.Data.SQLite.dll, it works. The problem is with SQLite.Interop.dll library.

I use .NET v4 [Visual Basic 2010].

I really need your help, Regards.

1条回答
Animai°情兽
2楼-- · 2019-08-27 04:13

This cannot work because the SQLite.interop.dll is not a managed assembly.

ILMerge can only read and combine managed assemblies into a new managed assembly. If you have to mix native dlls and managed assemblies you need to create either a setup/msi or a bootstrapper.

查看更多
登录 后发表回答