We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code will cause this host to hang forever (if you try to stop your app by closing the main window)
public App() { Startup += App_Startup; Exit += App_Exit; } private async void App_Exit(object sender, ExitEventArgs e) { try { await this.host.StopAsync(TimeSpan.FromSeconds(5)); } catch (Exception ex) { if (this.logger == null) Trace.TraceError("Error when stopping app: {0}", ex); else this.logger.LogError(ex, "Error when stopping app"); } finally { this.host.Dispose(); this.host = null; } } private async void App_Startup(object sender, StartupEventArgs e) { host = CreateHostBuilder().Build(); this.logger = host.Services.GetService<ILogger<App>>(); try { await this.host.StartAsync(); var mainWindow = host.Services.GetRequiredService<MainWindow>(); mainWindow.Show(); } catch (Exception ex) { if (this.logger == null) Trace.TraceError("Error when starting app: {0}", ex); else this.logger.LogError(ex, "Error when starting app"); Current.Shutdown(-1); } } public IHostBuilder CreateHostBuilder() { var hostBuilder = new HostBuilder() .UseServiceProviderFactory(new WindsorServiceProviderFactory()); return hostBuilder; }
The text was updated successfully, but these errors were encountered:
hi
Can you confirm this is related to WindsorServiceProviderFactory?
WindsorServiceProviderFactory
Sorry, something went wrong.
WpfApp2.zip
If you run this application, and then close the main window, the application will never shut down.
If I use the official package located at https://www.nuget.org/packages/Castle.Windsor.Extensions.DependencyInjection/ the problem goes away. In this case, you can change the using statements.
Now that there is the Castle.Windsor.Extensions.DependencyInjection package, maybe you can use it directly.
Castle.Windsor.Extensions.DependencyInjection
No branches or pull requests
The following code will cause this host to hang forever (if you try to stop your app by closing the main window)
The text was updated successfully, but these errors were encountered: