Documentation icon indicating copy to clipboard operation
Documentation copied to clipboard

WinForms problem with main view using DI

Open lordofscripts opened this issue 8 years ago • 1 comments

The documentation gives an example of how to use Simple Injector in WinForms projects. The example shows the code for the main view/main form with only a DI constructor.

The problem is, that the code as given throws an exception in one of the SI lines stating that the main view requires a parameterless constructor!

If I put the default constructor then the form does not work well.

lordofscripts avatar Sep 07 '17 21:09 lordofscripts

Constructor injection in Forms does work, so there is something going on that we can't determine from your question. Please share are a minimal complete verifiable example.

dotnetjunkie avatar Sep 08 '17 09:09 dotnetjunkie