I am trying to get this convention configuration working but I am having a problem in my ASP.NET MVC5 Project..
I have added the following in my Application_Start method and hooked it up to DependencyResolver
public static IUnityContainer CreateContainer()
{
IUnityContainer container = new UnityContainer();
container.RegisterTypes(
AllClasses.FromAssembliesInBasePath(),
WithMappings.FromAllInterfaces,
WithName.Default,
WithLifetime.ContainerControlled);
return container;
}
But it fails to register any types, on closer inspection, when I see whats in AllClasses.FromAssembliesInBasePath() it always runs null or empty.
Am I doing something wrong? is there a better place I should put this?
Thanks. Ste.