1

Closed

ViewLocator Failure

description

I tried Caliburn.Micro for the first time today and as a couple of others experienced I initially had problems due to AppBootstrapper and some other files not being copied/included to the solution when using NuGet.

After I resolved that I was experimenting, moving ShellView.xaml into a Views folder (and the ShellViewModel into a ViewModels folder) and amending the namespace(s) accordingly. Unfortunately during this I accidentally named the folder 'ViewModel' (singular), as I was amending the namespace I noticed this typo and so changed the namespace to match the folder name. The project compiled but at run-time I got the "Cannot find view for CaliburnTest1.ViewModel.ShellViewModel.". Obviously changing the namespace to 'ViewModels', regardless of its actual location, resolved this problem.

It seems to me that this is exceedingly restrictive, I should be free to use namespace names of my choice.
Closed Jul 23, 2012 at 9:10 PM by EisenbergEffect
Fixed as of f6e51de56988

comments

tibel wrote Jul 20, 2012 at 2:49 PM

You describe two different issues here:

1) NuGet issue: is a duplicate of http://caliburnmicro.codeplex.com/workitem/237)
2) TypeResolver uses conventions to find the view for a viewmodel. And YES they can be changed!!!
For details read "Handling Custom Conventions" in the documentation.