Base solution for your next web application
Open Closed

New Project DI not working #1338


User avatar
0
justin created

I added a new Proejct to solution on top of template given by aspnetboilerplate.com. i added a class like following

using Abp.Dependency;
public class CardManager: ICardManager, ISingletonDependency
{
.
.
.
}

My Application Project service class(CardAppService) has dependency on this class and on my Unit Test _cardAppService = Resolve<CardAppService>(); it fails saying An exception of type 'Castle.MicroKernel.Handlers.HandlerException' occurred in Castle.Windsor.dll but was not handled in user code

Additional information: Can't create component 'EMR.Card.CardAppService' as it has dependencies to be satisfied.

'EMR.Card.CardAppService' is waiting for the following dependencies: - Service 'EMR.Manager.Service.ICardManager' which was not registered.

i was in a impression that if you have ISingletonDependency or ITransientDependency it gets registered up automatically.


1 Answer(s)
  • User Avatar
    0
    justin created

    Found out that you need to use per project

    : AbpModule { public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); }