at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.IsConventionalRegistrationDisabled(Type type)
at Volo.Abp.DependencyInjection.DefaultConventionalRegistrar.AddType(IServiceCollection services, Type type)
at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.AddTypes(IServiceCollection services, Type[] types)
at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.AddAssembly(IServiceCollection services, Assembly assembly)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionConventionalRegistrationExtensions.AddAssembly(IServiceCollection services, Assembly assembly)
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at Foundation.Program.Main(String[] args) in /home/sulay/Documents/GitHub/Foundation/src/Foundation.HttpApi.Host/Program.cs:line 36
- Steps to reproduce the issue:
6 Answer(s)
-
0
- The exception trace you provided indicates an issue during ABP's conventional dependency injection registration, specifically in the
IsConventionalRegistrationDisabled(Type type)
method. This usually happens if there is a type in your project that cannot be registered conventionally, or if there is a misconfiguration in your module or dependency injection setup.
To resolve this:
Check for Abstract or Generic Types:
Ensure you do not have abstract classes, open generic types, or types that should not be registered (such as base classes or marker interfaces) in your module assemblies. ABP tries to register all types it finds by convention, so any type that cannot be instantiated will cause this error.Disable Conventional Registration for Problematic Types:
If you have a type that should not be registered, you can disable its conventional registration by using the[DisableConventionalRegistration]
attribute:[DisableConventionalRegistration] public abstract class MyBaseService { // ... }
Or, you can override the
IsConventionalRegistrationDisabled
method in your custom registrar if you have one.Check Your Module Dependencies:
Make sure your module dependencies are correct and do not reference assemblies that are not meant to be scanned for DI registration.Review Recent Changes:
If this error started after adding a new service, class, or module, review those changes for types that should not be registered.Clean and Rebuild:
Sometimes, stale binaries can cause issues. Clean your solution and rebuild.Check for Duplicate or Conflicting Types:
Ensure there are no duplicate types or conflicting class names across your assemblies.
If you need to debug further, you can temporarily comment out or remove recently added classes or modules to isolate the problematic type.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
- The exception trace you provided indicates an issue during ABP's conventional dependency injection registration, specifically in the
-
0
hi
Can you share full logs?
Thanks.
-
0
Hi,
You mean the Debug console logs, correct ?
-
0
Hi
There is a Logs\Logs.txt file under your project folder.
You can share it with liming.ma@volosoft.com
Thanks.
-
0
Hi,
the logs content could just be pasted here, so here it is:
2025-07-04 11:21:19.468 +00:00 [INF] Starting Foundation.HttpApi.Host. 2025-07-04 11:21:28.148 +00:00 [FTL] Host terminated unexpectedly! System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.IsConventionalRegistrationDisabled(Type type) at Volo.Abp.DependencyInjection.DefaultConventionalRegistrar.AddType(IServiceCollection services, Type type) at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.AddTypes(IServiceCollection services, Type[] types) at Volo.Abp.DependencyInjection.ConventionalRegistrarBase.AddAssembly(IServiceCollection services, Assembly assembly) at Microsoft.Extensions.DependencyInjection.ServiceCollectionConventionalRegistrationExtensions.AddAssembly(IServiceCollection services, Assembly assembly) at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction) at Foundation.Program.Main(String[] args) in /home/sulay/Documents/GitHub/Foundation/src/Foundation.HttpApi.Host/Program.cs:line 36 -
0
hi
Could you share a project that reproduces this issue?
liming.ma@volosoft.com
Thanks