I have created a plugin architecture in C# app. In special folder I upload dlls and system search for certain interface and using reflection invokes function within plugin. But one of plugins (dlls) references to Open.XML dll which is not installed on the server where app is running. Is it a way to create a plugin ( compile it ?) that contains all libraries that it needs. Or it should be done in a different way?
Asked
Active
Viewed 199 times
1 Answers
0
1) Distribute any required DLLs together with the plugin DLL, and put them inside the plugin folder. Either add the plugin folder to the probing path for assemblies in the app.config, or add a handler for the AssemblyResolve
event.
2) Use ILMerge
to combine the plugin and required assemblies into one assembly.
If you load all plugins into the same app domain, this will cause funny issues if the same types are merged into multiple plugins.

gnud
- 77,584
- 5
- 64
- 78
-
I have tried ILMerge from command line but during merging my plugin (C# class library) and OpenXML dll - program create empty dll and is not responding. In log there is no error. The last library loged is always: System.Data.SqlXml.dll' – Lukasz Jun 15 '18 at 14:11