if i use
Assembly assembly = Assembly.LoadFrom(file);
当我尝试使用文件时,我遇到了一个异常,说明文件正在被使用。
我需要将它加载到一个新的应用程序域中。
我发现所有的例子都是如何在程序集内创建一个实例,有没有一种方法可以加载整个程序集。
我需要做的是:
(1) load the assembly into a new AppDomain from a file .
(2) extract an embedded resource (xml file) from the Dll .
(3) extract a type of class which implements an interface (which i know the interface type) .
(4) unload the entire appdomain in order to free the file .
2-4不是问题
我只是找不到如何将程序集加载到新的AppDomin中,只有创建实例的示例,这使我从Dll内得到了该类的实例。
我需要整个过程。
就像这个问题中提供的另一个示例:创建实例的另一个示例。