Q: Using app domains in C# I have come to the conclusion that using app domains for my project will be the best way to do it.  I have to load different dll files into my project to use written from different developers.  I have no clue where to start looking, and not entirely sure on how it all works.  I have looked at a few examples, but they do not give me an clear understanding of what to do.
What I would like to know is, if I have a dll and load it into a app domain, will I be able to use the public methods within that dll, or how is this app domains used? I would also like someone who can maybe provide me with an tutorial link on how to use this, loading my dll, and accessing/using it.
Thanks in advance

A: If you want to load a urefrenced dll of project in new appdomain at runtime then you need to mix reflection and app domain concept. It means load the dll using reflection in diffrent appdomain.
Sample code for your problem:
static void UsereflectionWithAppDomain()
{
    AppDomain mydomain = AppDomain.CreateDomain("MyDomain");
    MethodInfo mi = default(MethodInfo);

    // Once the files are generated, this call is
    // actually no longer necessary.

    byte[] rawAssembly = loadFile(@"d:\RelectionDLL.dll");

    // rawSymbolStore - debug point are optional.
    byte[] rawSymbolStore = loadFile(@"d:\RelectionDLL.pdb");
    Assembly assembly = mydomain.Load(rawAssembly, rawSymbolStore);

    Type reflectionClassType = assembly.GetType("ReflectionDLL.MyStaicClass");

    mi = reflectionClassType.GetMethod("PrintI");
    mi.Invoke(null, null);

    AppDomain.Unload(mydomain);
}


// Loads the content of a file to a byte array. 
static byte[] loadFile(string filename)
{
    FileStream fs = new FileStream(filename, FileMode.Open);
    byte[] buffer = new byte[(int)fs.Length];
    fs.Read(buffer, 0, buffer.Length);
    fs.Close();

    return buffer;
}

