I have a service that accepts IMyDependency in its constructor. IMyDependency, MyDependency and all services live in the same assembly. MyDependency has a single, open, parameterless constructor.
To my surprise, this did not work:
container.RegisterAutoWired<IMyDependency>();
It throws a "System.NullReferenceException" exception.
It works if I do this:
container.RegisterAutoWiredAs<MyDependency, IMyDependency>();
But then so:
container.RegisterAs<MyDependency, IMyDependency>();
So what is the difference? If "automatic posting" cannot find a specific implementation, and it does not matter if services requiring dependencies can be resolved, then what is automatic posting?
Is Funq supposed to be able to find your specific implementations by convention? If so, what is this agreement, if not the same name-ness?
Thanks.
source share