简体   繁体   English

使用AppDomain从程序集创建对象实例

[英]Create object instance from assembly using AppDomain

I have a class library ClassLibrary1.dll in c:\\MyDll\\ClassLibrary1.dll with this 我在c:\\ MyDll \\ ClassLibrary1.dll中有一个类库ClassLibrary1.dll

public class Class1
{
    public void Run()
    {
        Console.WriteLine("Inside Class 1 Library ");
    }
}

Using AppDomain how would i create a instance for the class Class1 and execute the method "Run" in .net 2.0 Note: I do not want to use Assembly.LoadFile 使用AppDomain如何为Class1类创建实例并在.net 2.0中执行方法“运行”注意:我不想使用Assembly.LoadFile

This page discusses creating app domains, loading assemblies and types into that app domain, and then closing the app domain: 此页面讨论创建应用程序域,将程序集和类型加载到该应用程序域中,然后关闭该应用程序域:

http://msdn.microsoft.com/en-us/library/yk22e11a.aspx http://msdn.microsoft.com/zh-CN/library/yk22e11a.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM