宿主程序加载插件有3种方法:即Assembly.Load 方法、Assembly.LoadFile 方法、及Assembly.LoadForm 方法,具体使用如下:
1、Assembly.Load 方法
本例现将文件读入内存,然后加载插件程序集,此处使用Load(Byte[]) 方法,加载带有基于通用对象文件格式 (COFF) 的映像的程序集,该映像包含已发出的程序集。 此程序集将会加载到调用方的应用程序域中。
string pluginPath = Path.GetDirectoryName(Application.ExecutablePath);
pluginPath = Path.Combine(pluginPath,