Custom ABP module - dependency injection error - Console Application
See original GitHub issue- Your Abp package version. 7.3.0
- Your base framework: .Net Core.
- Exception message and stack trace if available.:
** No component for supporting the service IInventoryRepository was found’
I have downloaded Startup template as AspNetCore + Angular
I’ve created custom module console application look like this (as I followed migration module)
Custom module has ApplicationModule project dependency
[DependsOn(typeof(InventoryApplicationModule))]
public class MasterDataSubscriberModule : AbpModule
{
public override void PreInitialize()
{
Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
}
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(typeof(MasterDataSubscriberModule).GetAssembly());
}
}
This is program.cs
using (var bootstrapper = AbpBootstrapper.Create<MasterDataSubscriberModule>())
{
bootstrapper.Initialize();
using var scope = bootstrapper.IocManager.CreateScope();
var repository = scope.ResolveAsDisposable<IInventoryRepository>();
Console.ReadLine();
}
I tried to get some repository from container. But I’ve took
“Castle.MicroKernel.ComponentNotFoundException: ‘No component for supporting the service IInventoryRepository was found’”
IInventoryRepository has kinda custom repository implementation
public interface IInventoryRepository : IRepository<Inventory, int>
{
}
I need help Thanks.
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Dependency Injection | Documentation Center | ABP.IO
ABP's Dependency Injection system is developed based on Microsoft's dependency injection extension library (Microsoft.Extensions.DependencyInjection nuget ...
Read more >Customizing Application Modules Overriding Services
Replacing a service is possible for any type of class registered to the dependency injection, including services of the ABP Framework. You have...
Read more >Dependency Injection failure using the ABP Framework
I am struggling with making the getResult method run correctly and resolving the associated error. I am unsure of what exactly is causing...
Read more >Exception injecting IRepository<MyEntity,Guid> in an ABP ...
I am trying to write a utility console app that has MySQL database access. ... It is failing with an exception: Autofac.Core.
Read more >Dependency Injection issue from Console Application ...
When the console application is run I get dependency injection error in this line in CoreModule PostInitiliaze method: IocManager.Resolve<ChatUserStateWatcher>() ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@onurcanyilmaz I assume this is because the implemenation of the repository is in EntityFrameworkCore project.
@onurcanyilmaz for quick fix please check https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6590