I'm trying to use Simple Injector in a Windows Forms application. Unfortunately, the documentation at https://simpleinjector.readthedocs.org/en/latest/windowsformsintegration.html is not correct or is out of date.
When you actually run the example, it results in the following error:
The configuration is invalid. The following diagnostic warnings were reported:
-[Disposable Transient Component] MainView is registered as transient, but implements IDisposable.
Furthermore, the app I'm building is a Winforms MVP (passive view) project. I can change the scope of MainView to singleton and it works. But for the life of me, I cannot figure out how to open other windows because of this scoping issue. Has anyone successfully used SimpleInjector in a real-world MVP winforms application with multiple windows? I'm curious to see how Presenters, Forms/Views, and the Main entry point are configured and what their Lifestyle scopes are.
Just for reference, I've tried using LifetimeScoping and ExecutionContextScoping extensions, but absolutely nothing has worked. Maybe it's just a PEBKAC issue.
Thanks, Eric