I'm using Caliburn.Micro bootstrapper here:
https://gist.github.com/1127914
Everything works if I keep all views and viewmodels in the same project as the bootstratpper.
But I wanted to push the Views and ViewModels folder to another assembly/project, I do, change the namespaces, update the bootstrapper to find that viewmodel. Now when I run I get the error about
"No component for supporting the service MVVMBook.ViewModules.ViewModels.MainViewModel was found"
on this part of the bootstrapper:
return string.IsNullOrWhiteSpace(key)
? _container.Resolve(service)
: _container.Resolve(key, service);
Obviously it is not able to wire up the ViewModel, even though the VM is set as the generic parameter to the Bootstrapper:
public class CastleBootstrapper : Bootstrapper<MainViewModel>
The naming convention I'm using is a folder called Views and a Folder called ViewModels and the files are MainView.xaml and MainViewModel.cs
Where can I tell it to look in this assembly?
Also added this piece to the bootstrapper as it was recommended when views and viewmodels are in a separate assembly but didn't resolve the issue:
// needed if views and viewmodels are in a seperate assembly
protected override IEnumerable<Assembly> SelectAssemblies()
{
return new[]
{
Assembly.GetExecutingAssembly()
};
}