Caliburn.Micro.Autofac
Caliburn.Micro.Autofac copied to clipboard
GetInstance not complete (missing ServiceType == null case)
When trying to use Bind.Model in xaml the Caliburn.Micro.Bind.ModelChanged function will call IoC.GetInstance(null, key), which is not handled in the bootstrapper getinstance method.
Autofac does not support resolving by name without a type. When I checked the Caliburn.Micro discussions on this issue, there was a change recently to other areas of the code base to eliminate this type of look up. I am going to check with Rob to see if this is behavior is intended.
When I looked at the CM code, this seems like something that be easily resolved. The type is known at the point of the GetInstance call, it is just not used.
The link to the Caliburn.Micro discussion topic is http://caliburnmicro.codeplex.com/discussions/270835.
thanks. let me know if you find out anything more. I agree that it's an issue in caliburn as it (obviously) leaves restrictions on IOC when not necessary. I've had to hack in my own fix for now.
What did you do as a fix?
I just overrode GetInstance, and when the specific key name was passed in i had to create an if statement and then manually trying to resolve by the corresponding type. Not really a clean solution, but the only one. I'm sure i could make it more generic, but i don't have time to deal with it.