日期:2014-05-18 浏览次数:20399 次
domain = AppDomain.CreateDomain(name, null, AppDomain.CurrentDomain.BaseDirectory, "bin", true);//由于运用程序一定会引用到这个DLL,所以这里直接写死到bin目录下 Type type = typeof(SmartPluginInstanceFactory); //创建工厂实例化 //factory = (SmartPluginInstanceFactory)domain.CreateInstance(type.Assembly.FullName, type.FullName).Unwrap();//理想化写法 factory = (SmartPluginInstanceFactory)domain.CreateInstanceFromAndUnwrap(AppDomain.CurrentDomain.BaseDirectory + "bin\\Plugin.dll", "Plugin.SmartPluginInstanceFactory");