I have a WPF desktop app.
My idea is this:
My installed application starts up and makes a connection to my server.
The client app then loads my Views and DLL Logic/Resources into RAM.
This is how i do that:
var uri = "http://127.0.0.1/Dll/MyControls.Dll";
var data = new System.Net.WebClient().DownloadData(uri);
var ViewAssembly = System.Reflection.Assembly.Load(data);
foreach (Type type in ViewAssembly.GetExportedTypes())
if (type.FullName.IndexOf(".Plugin") > 0)
dynamic obj = Activator.CreateInstance(type);
UserControl wnd = obj.GetControl();
uri = "http://127.0.0.1/Dll/Biz.Dll";
data = new System.Net.WebClient().DownloadData(uri);
var DLLAssembly = System.Reflection.Assembly.Load(data);
Type myType = DLLAssembly.GetType("Biz.Logic");
If you load both assemblies before calling
Activator.CreateInstace your code will work. It doesn't make a difference for runtime whether your dll is loaded from harddrive or byte array through
Assembly.Load, so if you know all dependencies beforehand, you can preload all of them.
In case you don't know what assemblies will be needed at runtime you can always subscribe to AppDomain.AssemblyResolve event and download only requested dll's.