Unable to step into interface implementation configured by unity application block
Posted
by
Rahul
on Stack Overflow
See other posts from Stack Overflow
or by Rahul
Published on 2012-06-10T03:41:58Z
Indexed on
2012/06/24
9:16 UTC
Read the original article
Hit count: 264
I have configured a set of interface implementations with EntLib. unity block. The constructor of implementation classes work fine as soon as I run the application: 1. The interface to implement
when I run the application the cctor runs fine, which shows that unity resolution was successful:
But when I try to call a method of this class, the code just passes through without actually invoking the function of the implemented class:
Edit: Added on June 11, 2012 Following is the Unity Configuration I have. (This is all the unity configuration I am doing)
public class UnityControllerFactory : DefaultControllerFactory
{
private static readonly IUnityContainer container;
private static UnityControllerFactory factory = null;
static UnityControllerFactory()
{
container = new UnityContainer();
UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
section.Configure(container);
factory = new UnityControllerFactory();
}
public static UnityControllerFactory GetControllerFactory()
{
return factory;
}
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
return container.Resolve(controllerType) as IController;
}
}
I am unable to step into this code and the implementation simply skips out without executing anything. What is wrong here?
© Stack Overflow or respective owner