Closed nodyang closed 5 years ago
我模仿autofac fasthttpapi 依赖注入
注入也成功了。但是控制台报错。程序好像只走了空的构造。。 我注册了这个事件。但跟踪后发现。他一直为null
Register HelloWorldService error No parameterless constructor defined for this object.@ at System.RuntimeTypeHandle.CreateInsta nce(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at EventNext.EventCenter.CreateController(Type type) at EventNext.EventCenter.Register(Assembly[] assemblies)
我模仿autofac fasthttpapi 依赖注入
注入也成功了。但是控制台报错。程序好像只走了空的构造。。 我注册了这个事件。但跟踪后发现。他一直为null
Register HelloWorldService error No parameterless constructor defined for this object.@ at System.RuntimeTypeHandle.CreateInsta nce(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at EventNext.EventCenter.CreateController(Type type) at EventNext.EventCenter.Register(Assembly[] assemblies)