Unable to step into interface implementation configured by unity application block
- by Rahul
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?