C# Autofac IComponentContext。注册为空
我的核心项目中有IDispatcher接口:C# Autofac IComponentContext。注册为空,c#,autofac,C#,Autofac,我的核心项目中有IDispatcher接口: public interface IDispatcher { ... } 在基础设施项目中,我正在实施: public class AutofacDispatcher : IDispatcher { private readonly IComponentContext container; public AutofacDispatcher(IComponentContext container) {
public interface IDispatcher
{
...
}
在基础设施项目中,我正在实施:
public class AutofacDispatcher : IDispatcher
{
private readonly IComponentContext container;
public AutofacDispatcher(IComponentContext container)
{
this.container = container;
}
...
}
现在当我打电话时:
var dispatcher = container.Resolve<IDispatcher>();
var dispatcher=container.Resolve();
Dispatcher中的专用IComponentContext为空且没有注册
为什么会这样?我怎样才能让它工作呢?好吧,我自己想出来的 我有太多的容器注册(超过7k) 我设法只引用了我的程序集,现在它开始工作了