표시된대로 here으로 구성 요소/서비스를 등록하고 있으며 아래에 표시된 클래스도 구현 중입니다. 내가 Reload를 호출했을 때, 등록되지 않았고 그 사실을 알았습니다. 어떤 아이디어?Autofac이 등록 된 유형을 확인하지 못합니다.
public interface ITypeReloader
{
PluginBase Reload(Type type);
}
public class TypeReloader
{
IComponentContext _container;
public TypeReloader(IComponentContext container)
{
_container = container;
}
public PluginBase Reload(Type type)
{
(PluginBase)_container.Resolve(type); //Not registered error
}
}
누락 된 것이 없습니다. 나는 그들이 pluginbase를 해결할 수있는 pluginbase를 상속받은 클래스를 등록했다는 것을 안다. 그리고 그것은 다양한 인스턴스를 준다. – Jon
나는 같은 등록을 유지했지만 AsSelf를 추가했는데 성공한 것으로 보인다! 그래서 그것으로있다() .AsSelf() –
Jon
그게 무슨 뜻인지 모르겠지만! – Jon