internal void Load() { (Assemblies as List <string>).Clear(); foreach (FileInfo f in new DirectoryInfo(Path).GetFiles("*.dll", SearchOption.TopDirectoryOnly)) { if (isDotNetAssembly(f.FullName)) { (Assemblies as List <string>).Add(f.FullName); } } if (Domain != null) { FireHandleUnloadAppDomain(); Domain = null; } Domain = ProxyDomain.CreateDomain(PluginId.ToString(), Path); foreach (string p in Assemblies) { Domain.LoadAssembly(p); } AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve; var m = Domain.Create <IPlugin>(); _plugin = m; }
public void TestToString() { var id = new PluginId("MyCompany.Namespace.Log"); id.ToString().Should().Be("MyCompany.Namespace.Log"); }