After upgrading from ABP 8.2.3 to 8.3.2, I encountered a runtime error related to dependency injection. The error appears when launching the application and states:
RuntimeError: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`.
The error seems to originate from services like ToasterService and LinkLoginHandler. Prior to the upgrade, the application was working without this issue. I've attached a screenshot of the console output for reference.
Steps to Reproduce:
Expected Behavior: The application should run without dependency injection errors after the upgrade.
Actual Behavior: The application fails to properly inject services, leading to runtime errors and a disrupted user experience.
Note: We are using the Lepton theme in our Angular project Also, could you provide guidance on how to specify the Lepton theme when creating a new project using the ABP CLI? The current documentation only mentions creating projects with the --theme parameter for Basic or Lepton-X themes. However, we are specifically using the Lepton theme. How should the command be structured to use Lepton as the theme?
The Account and Identity Management pages now occupy only 50% of the screen width, whereas the Lepton Theme page opens at 100% width. Recently, we upgraded our ABP version from 6.0.3 to 8.2.3. Previously, all these pages were displayed at 100% width. We have also set newly added pages to open at 100% width for consistency. However, there is now an inconsistency where some pages use 50% width while others use 100%. Could you restore the previous behavior so that all pages open at 100% width?
Hi,
We fixed the problem, and it will included in the next patch version.
https://github.com/abpframework/abp/commit/544e24d85fc2d0f5da987f1a2607323ec4fb7a84
you can try disabled for now
Configure<AbpMvcLibsOptions>(options =>{ options.CheckLibs = false; });
hi
thanks for the reply, for now my problem is solved with this method.
An error occurred while checking the libs folder! System.ArgumentException: The path must be absolute. (Parameter 'root') at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) at Volo.Abp.AspNetCore.Mvc.Libs.AbpMvcLibsService.CheckLibsAsync(HttpContext httpContext)
I am encountering an issue in the AbpMvcLibsService class where httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootPath returns null. This causes an error as the PhysicalFileProvider class does not accept null values.
As a temporary workaround, I created a wwwroot directory in the folder structure of the HttpApi.Host project. Inside this directory, I added a libs folder and created a dummy file within it. This resolves the issue temporarily, but I would appreciate your assistance in addressing the root cause of this problem and finding a proper solution.
Thank you for your support!
hi
Please share the full error stack and the code of
EntityDomainService
Thanks.
Hi
I share the codes in a masked form. If you need a clear version and more details, I can send it via e-mail or private ticket.
There is no problem when calling the following DomainService from AppService. However, from within DbMigrator _serviceProvider.GetRequiredService<IEntityDomainService
>(); When called like this, an error is received.
Share your domain service?
It seems it is not registered to DI, perhaps you forgot to extend the
DomainService
base class.
I use Abp's DomainService
and IDomainService
classes as base. There is no problem while the Http API project is running. But the DbMigrator project cannot resolve DI. Because DbMigrator cannot access the Domain layer by default.
When I try to reach the Domain Service with the Service Provider in DataSeedContributor, I get the error as follows. How can I use Domain Service methods in the DataSeedContributor class?
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Example.Project.Entities.EntityDomainService. ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Example.Project.Entities.EntityDomainService' can be invoked with the available services and parameters:
I am experiencing localization issues, as seen in the above images. How can we fix them?
We use Abp Db migrator in our CI/CD pipeline to apply migrations forward. However in a production environment when an upgrade causes an unexpected behaviour/bug, it is also needed to rollback to the previous version of the app with the matching db structure. Since DB Migrator is used to apply migrations forward, I guess it is a good candidate to make the rollback as well. I wonder if it is possible to add this feature to the framework and if it is already in the roadmap for some future relaeses. If not could you please explain why this feature is not covered in any future time?
IMO the following features may be included to the DB Migrator: