diff --git a/Templates.csproj b/Templates.csproj index 0f52fba..e63dbc4 100644 --- a/Templates.csproj +++ b/Templates.csproj @@ -2,7 +2,7 @@ Template - 1.4.1 + 1.4.2 Keboo.Dotnet.Templates Keboo's .NET Templates Keboo diff --git a/templates/WPF/WpfApp/WpfApp/App.xaml.cs b/templates/WPF/WpfApp/WpfApp/App.xaml.cs index de02f51..91455c7 100644 --- a/templates/WPF/WpfApp/WpfApp/App.xaml.cs +++ b/templates/WPF/WpfApp/WpfApp/App.xaml.cs @@ -14,16 +14,23 @@ namespace WpfApp; public partial class App : Application { [STAThread] - public static void Main(string[] args) + private static void Main(string[] args) + { + MainAsync(args).GetAwaiter().GetResult(); + } + + private static async Task MainAsync(string[] args) { using IHost host = CreateHostBuilder(args).Build(); - host.Start(); + await host.StartAsync().ConfigureAwait(true); App app = new(); app.InitializeComponent(); app.MainWindow = host.Services.GetRequiredService(); app.MainWindow.Visibility = Visibility.Visible; app.Run(); + + await host.StopAsync().ConfigureAwait(true); } public static IHostBuilder CreateHostBuilder(string[] args) =>