are there any alternatives to AppDomainSetup and CreateInstanceAndUnwrap for net-Standard2.0

336 Views Asked by At

Im trying to make my code compile in netStandard2.0 and cant get over this. AppDomain is supported but has limmited methods. And AppDomainSetup is not supported. i have the following code that right now is Net Framework 4.7.1 compatible. is there any alternative to make it compile on NetStandard2.0??

AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = m_ApplicationBase;
setup.PrivateBinPath = m_PrivateBinPath;

setup.ApplicationName = "TemplateCompiler " + m_AppDomainCount;
setup.LoaderOptimization = LoaderOptimization.SingleDomain;
m_AppDomain = AppDomain.CreateDomain("TemplateCompiler Appdomain " + 
m_AppDomainCount, null, setup);
m_AppDomain.AssemblyResolve += AppDomainAssemblyResolve;

m_RemoteLoader = (RemoteLoader) m_AppDomain.CreateInstanceAndUnwrap 
(Assembly.GetExecutingAssembly().FullName, typeof(RemoteLoader).FullName);
0

There are 0 best solutions below