beetlex-io / XRPC

dotnet high performance remote interface and delegate invoke(RPC) communication components,support millions RPS remote interface method invokes
Apache License 2.0
84 stars 22 forks source link

autofac 依赖注入 #4

Closed nodyang closed 5 years ago

nodyang commented 5 years ago

我模仿autofac fasthttpapi 依赖注入 image

image 注入也成功了。但是控制台报错。程序好像只走了空的构造。。 image 我注册了这个事件。但跟踪后发现。他一直为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)