Bootstrapper with Unity Yields Exception

Topics: Bootstrappers & IoC
Mar 4, 2013 at 4:06 PM
Edited Mar 4, 2013 at 4:08 PM
Greetings

I am using Unity as my IOC container in the bootstrapper. In version 1.3.1, the below simplified bootstrapper runs fine. However, in versions 1.4 and 1.4.1, the below bootstrapper throws a ResolutionFailedException on the following line saying that the unity container can not resolve an object of type Caliburn.Micro.IWindowManager:
var result = _container.Resolve(serviceType, key);
Can someone please verify whether this is a bug in 1.4/1.4.1 or if it was a fix in 1.4/1.4.1 that is now causing desired behavior. Thank you.

        protected override void Configure()
        {
            _container = new UnityContainer();
            _container.RegisterType<IShellViewModel, ShellViewModel>();
        }

        protected override object GetInstance(Type serviceType, string key)
        {
            var result = _container.Resolve(serviceType, key);

            if (result == null)
                throw new Exception(string.Format("Could not locate any instance of contract {0}", serviceType.ToString()));

            return result;
        }

        protected override IEnumerable<object> GetAllInstances(Type service)
        {
            return _container.ResolveAll(service);
        }

        protected override void BuildUp(object instance)
        {
            _container.BuildUp(instance);
        }

        protected override IEnumerable<System.Reflection.Assembly> SelectAssemblies()
        {
            return new[] {
                Assembly.GetExecutingAssembly()
            };
        }
    }