private static void Main(string[] args) { #if NET461 if (!AppDomain.CurrentDomain.ShadowCopyFiles) { var appDomain = AppDomain.CreateDomain("SecondaryDomainShadowCopyAllowed", null, new AppDomainSetup { ShadowCopyFiles = "true" }); appDomain.ExecuteAssemblyByName(typeof(Program).Assembly.FullName, args); return; } #endif Program2.ContinueMain(args); }
private static void Main(string[] args) { try { #if NET461 if (!AppDomain.CurrentDomain.ShadowCopyFiles) { var appDomain = AppDomain.CreateDomain("SecondaryDomainShadowCopyAllowed", null, new AppDomainSetup { ShadowCopyFiles = "true" }); appDomain.ExecuteAssemblyByName(typeof(Program).Assembly.FullName, args); return; } #endif Program2.ContinueMain(args); } catch (Exception e) { Console.WriteLine(@"!#" + e); throw; } }