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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -