public void Entry() { try { var log = VerboseLogger(); Log.Logger = log; LoggingServices.DefaultBackend = new SerilogLoggingBackend(log.ForContext("RuntimeContext", "PostSharp")); } catch (Exception ex) { Platform.Crash(); } try { Post.Cast<Runtime, IFreezable>(this).Freeze(); Post.Cast<GenericPlatform, IFreezable>(Platform).Freeze(); var cleanlyLaunch = Platform.Host.Start(Platform); var returned = cleanlyLaunch.ContinueWith((t) => { if (t.IsFaulted || t.IsCanceled) Platform .Crash($"Fatal exception in the generic platform at runtime{Environment.NewLine}{t.Exception?.ToString()}"); else _log .Information("Successfully launched the common platform from the runtime."); }); returned.Wait(); // Results in sink monitors receiving StopMonitoring calls. Log.CloseAndFlush(); } catch (ObjectReadOnlyException roEx) { _log.Fatal($"Property or state were attempted on a frozen object." + $"${Environment.NewLine}Runtime Freeze(): {roEx.Data}"); Platform.Crash("Fatal attempt to modify a frozen object."); } catch (ThreadMismatchException threadEx) { _log.Fatal($"An object was accessed from a different thread than it was created." + $"{Environment.NewLine}Please use a threading model or freeze the object before crossing boundaries." + $"{threadEx}"); Platform.Crash("Fatal thread access exception was thrown."); } catch (Exception ex) { _log.Fatal($"Could not freeze and launch the common platform from the runtime." + $"{Environment.NewLine}{ex}"); Platform.Crash("Unknown failure occurred in an EntryPointAttribute for the runtime."); } }