simpleinjector / Documentation

Documentation for Simple Injector in reStructureText
20 stars 55 forks source link

removing app.InitializeComponent() #128

Closed jan-oratowski closed 1 year ago

jan-oratowski commented 2 years ago

Looks like WPF (at least .net core 6 version) doesn't implement InitializeComponent() method in App.

image

If this line is present, the project will not compile, however if removed there are no side effects (everything runs as expected).

jan-oratowski commented 1 year ago

@simpleinjector any chance someone can merge it?

dotnetjunkie commented 1 year ago

Sorry for the long delay. I have to review and test this change to make sure that applications for none of the .NET frameworks are affected. Seems that in more recent versions of Visual Studio, Microsoft changed what code was generated for the App class under certain conditions. It seems that neither .NET 4 nor .NET Core variants now lack the InitializeComponent() method when the steps are followed in the documentation.

I, therefore, concluded that it's safe to remove the call to InitializeComponent() from the documentation.

Thanks for this PR.