I get the following exception while creating a brand new WinRT project, I have confirmed that the same project works fine when targeting v1.4, this only happens since targeting 1.4.1.
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
at Caliburn.Micro.ViewLocator.<.cctor>b__e(Object model, DependencyObject displayLocation, Object context) in c:\Projects\caliburnmicro\src\Caliburn.Micro.Silverlight\ViewLocator.cs:line 440
at Caliburn.Micro.CaliburnApplication.DisplayRootViewFor(Type viewModelType) in c:\Projects\caliburnmicro\src\Caliburn.Micro.WinRT\CaliburnApplication.cs:line 250
at Caliburn.Micro.CaliburnApplication.DisplayRootViewFor[T]() in c:\Projects\caliburnmicro\src\Caliburn.Micro.WinRT\CaliburnApplication.cs:line 268
at App6.App.OnLaunched(LaunchActivatedEventArgs args)
The project really is as simple as it gets, a new Blank windows store app with a ShellView.xaml and ShellViewModel.cs under the Shell namespace. Followed the
to modify App.xaml/cs and in OnLaunced a call to base.DisplayRootViewFor<Shell.ShellViewModel>();.
With some quick debugging it appears that in CaliburnApplication.cs line 249 IoC.GetInstance() is not returning an instance of the ViewModel and is instead returning null. Adding this.container.RegisterInstance(typeof(Shell.ShellViewModel), null, new Shell.ShellViewModel());
to the Configure override resolves the issue.
Is this expected behaviour or maybe an unforeseen consequence of
Many thanks, great work!