I'm using dependancy injection from Unity. i..e Unity.Mvc5. I fetch all types from the various assemblies
Assembly assembly = Assembly.LoadFrom(string.Format("{0}\\{1}", AppStartPath, containerElement.InterfaceAssembly));
Assembly assembly2 = Assembly.LoadFrom(string.Format("{0}\\{1}", AppStartPath, containerElement.ConcreteClassAssembly));
Type type = assembly.GetType(containerElement.InterfaceName);
Type type2 = assembly2.GetType(containerElement.ConcreteClass);
Now the following works when I pass the types:
container.RegisterType<IWarehouseBinController, WarehouseBinController>();
But this doesn't
container.RegisterType<type.GetTypeInfo().GetType(), type2.GetTypeInfo().GetType()>();
Anyone know why or how to resolve it? Basically I want to use this in an ASP.Net MVC site.