I want to create a new AppDomain. I try doing this : Create application domain and load assembly
But I don't know what type I'm suppose to give to my domain ...
var domain = AppDomain.CreateDomain("NewAppDomain");
var path = @"C:\work\SomeAssembly.dll";
var t = typeof(SomeType);
var instance = (SomeType)domain.CreateInstanceFromAndUnwrap(path, t.FullName);
What I really want to do is to create a temporary AppDomain that load an assembly and find its references. Then I would create another AppDomain and load all the referenced assemblies and the one in the temporary AppDomain. Finaly, I would unload the temporary AppDomain and work from the other AppDomain that I can unload when I use another assembly.
My principal question is : what is "SomeType" in the code above? ... What I'm suppose to put there?
Thanks!
typeof(typename)means that the assembly that containstypenamemust be loaded in the main appdomain (circumventing any need to load another). i.e. we don't know what you're trying to accomplish, so we can't really tell you what to put there. - Peter Ritchie