gagaddji
This commit is contained in:
parent
6cd523ce5c
commit
378b018d82
|
|
@ -13,11 +13,13 @@ public partial class App : Application
|
|||
Log("App ctor enter");
|
||||
try
|
||||
{
|
||||
InitializeComponent();
|
||||
AppDomain.CurrentDomain.FirstChanceException += (_, e) =>
|
||||
Log($"FirstChance: {e.Exception.GetType().Name}: {e.Exception.Message}");
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
|
||||
Log($"UnhandledException: {e.ExceptionObject}");
|
||||
UnhandledException += (_, e) =>
|
||||
Log($"XAML UnhandledException: {e.Exception}");
|
||||
InitializeComponent();
|
||||
Log("App ctor ok");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
|
||||
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace LayersShell;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
App.Log($"Main enter (args={args.Length})");
|
||||
try
|
||||
{
|
||||
WinRT.ComWrappersSupport.InitializeComWrappers();
|
||||
App.Log("ComWrappers initialised");
|
||||
Application.Start(_ =>
|
||||
{
|
||||
App.Log("Application.Start callback enter");
|
||||
var ctx = new DispatcherQueueSynchronizationContext(DispatcherQueue.GetForCurrentThread());
|
||||
SynchronizationContext.SetSynchronizationContext(ctx);
|
||||
App.Log("SyncContext set — creating App");
|
||||
_ = new App();
|
||||
App.Log("App instance created");
|
||||
});
|
||||
App.Log("Application.Start returned");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Log($"Main FAILED: {ex}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue