c# - Unity: The type is not interceptable -
i'm trying resolve dependency on class called within class service. registration this
private static iunitycontainer registerservices(this iunitycontainer container) { return container .registerwithpolicy<iservice, service>(new injectionproperty("unitycontainer", container)) .registerwithpolicy<icalled, called>() ; }
i use reflection find right implementation of icalled (there more 1 implementation of it).
var type = _typefinder.findmytype(myobject); var instance = (icalled)unitycontainer.resolve(type);
but when execute code error
exception is: argumentexception - type called not interceptable. parameter name: interceptedtype @ time of exception, container was: resolving namespace.called,(none)
i tried using servicelocator , enterpiselibrary resolve type, same error. cannot use activator since called (and other implementations) have different interface dependencies. hint?
Comments
Post a Comment