-
Notifications
You must be signed in to change notification settings - Fork 583
Open
Description
Hi,
I am using .NET 6.0 and RazorEngine.NetCore.
From documentation, I copy/paste the following snippet of code :
if (AppDomain.CurrentDomain.IsDefaultAppDomain())
{
// RazorEngine cannot clean up from the default appdomain...
Console.WriteLine("Switching to secound AppDomain, for RazorEngine...");
AppDomainSetup adSetup = new AppDomainSetup();
adSetup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
var current = AppDomain.CurrentDomain;
// You only need to add strongnames when your appdomain is not a full trust environment.
var strongNames = new StrongName[0];
var domain = AppDomain.CreateDomain(
"MyMainDomain", null,
current.SetupInformation, new PermissionSet(PermissionState.Unrestricted),
strongNames);
var exitCode = domain.ExecuteAssembly(Assembly.GetExecutingAssembly().Location);
// RazorEngine will cleanup.
AppDomain.Unload(domain);
return exitCode;
}
And I have a build error : 'AppDomainSetup' does not contain a constructor that takes 0 arguments.
What is the solution ? Is it possible to fix also the documentation please ?
Regards
Sybaris
Metadata
Metadata
Assignees
Labels
No labels