I have an object that I currently instantiate in the following way:
var ads = new AppDomainSetup
{
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
DisallowBindingRedirects = false,
DisallowCodeDownload = false,
ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
};
domain = AppDomain.CreateDomain("Monitor_" + Id, null, ads);
var sub = (CheckRequestHandler)domain.CreateInstanceAndUnwrap("Alertera.Business",
"Alertera.Business.Monitoring.CheckRequestHandler");
Is there a way that I can use Autofact to create it? THe object has other dependencies that I'd love for Autofac to handle. Do notice that I'm doing CreateInstanceAndUnwrap. This is important, so that the object is completely unloaded once finished processing. Furthermore, I would like to run that object in a different trust in the future.
Appreciate any advice if Autofac can help here.