Reputation: 2508
I'm reading a code which is creating an instance of a type in another Domain by reflection. Why do we need to do this? What is the advantages of this kind of instance creation?
AppDomain _domain = AppDomain.CreateDomain("ServerImporterDomain");
var type = typeof (ServerImporter);
ServerImporter si = _domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName) as ServerImporter;
Upvotes: 0
Views: 713
Reputation: 2112
Some reasons for this would be:
A good writeup is at http://blogs.msdn.com/b/cclayton/archive/2013/05/21/understanding-application-domains.aspx.
Upvotes: 1