public class TypeA : BaseType {}
并为它们设置IoC容器:container.RegisterType<Inspector>();var typeA = new TypeA(); //It could be alsocontainer.Resolve<Inspector&
在运行单元测试时,配置文件无法正确读取。但是,当从控制台应用程序上下文运行时,将读取配置文件。在下面的代码中,在赋值后访问var节时,运行测试TestIoCInit()时为null,从控制台应用程序调用InitIoC()时为null。= new UnityContainer(); // the host app domain creates the unity container and pass it to the resolverstatic member of