You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does the bug reproduce also in WPF for .NET Framework 4.8?: Not tested
Problem description:
when using MVVM pattern StartupUri property is deleted from app.xaml, instead in application.resource resource dictionary is added and static resource for view model locator is added. then resolving view and trying to call show on it will throw runtime exception "Cannot find resource named 'Locator'. Resource names are case sensitive.". Turns out when only single static resource is added InitializeComponent method is not generated. Work around inside resource dictionary add any mapping to merged resource dictionary then InitializeComponent method is generated and application works as expected
Expected behavior:
When added locator resource, InitializeComponent method should be generated
Minimal repro:
Was using Host class to enable core IoC and Mvvmlight
// App.xaml: not generating InitializeComponent
@dotnet/wpf-developers This reminds me of #2543. That reproduced in .NET 4.8 as well, it's likely a long-standing issue with PresentationBuildTasks generating code.
Problem description:
when using MVVM pattern StartupUri property is deleted from app.xaml, instead in application.resource resource dictionary is added and static resource for view model locator is added. then resolving view and trying to call show on it will throw runtime exception "Cannot find resource named 'Locator'. Resource names are case sensitive.". Turns out when only single static resource is added InitializeComponent method is not generated. Work around inside resource dictionary add any mapping to merged resource dictionary then InitializeComponent method is generated and application works as expected
Expected behavior:
When added locator resource, InitializeComponent method should be generated
Minimal repro:
Was using Host class to enable core IoC and Mvvmlight
// App.xaml: not generating InitializeComponent
// App.xaml generating InitializeComponent
// MainWindow.xaml
// ViewModelLocator
The text was updated successfully, but these errors were encountered: