Hi,
After upgrading our project from ABP Framework v9.3.7 to v10.1.1, we kept AutoMapper as our object mapping solution instead of the new default Mapperly.
We configured AutoMapper in our application module as follows:
public class MyApplicationModule : AbpModule
{
}
Inside ConfigureServices:
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<MyApplicationModule>();
});
Our AutoMapper profiles are discovered correctly, and mapping works as expected in our custom application services.
For example, mapping works without issues in:
public class MyCustomAppService : MyProjectAppService, IMyCustomAppService
However, when using the same mappings inside a service that derives from the ABP identity service:
public class MyProjectIdentityUserAppService : IdentityUserAppService
we receive an exception during execution. The exception indicates that the framework is attempting to resolve a mapping using Mapperly, even though AutoMapper is configured and working elsewhere in the application.
This suggests that the IdentityUserAppService (or the underlying object mapper context) is still trying to use Mapperly instead of AutoMapper after the upgrade.
Observed behavior:
- AutoMapper is configured and working correctly in custom application services.
- The same mappings fail when used in a service derived from IdentityUserAppService.
- The thrown exception suggests that the framework attempts to resolve mappings through Mapperly.
Expected behavior: Since AutoMapper is configured in the application module and works in other services, we would expect the same AutoMapper configuration to be used when extending IdentityUserAppService.
Is there an additional configuration required in ABP v10.1.1 to ensure that IdentityUserAppService uses AutoMapper instead of Mapperly? Or is there a recommended approach for overriding the object mapper context in services derived from IdentityUserAppService?
Any guidance on the correct configuration for using AutoMapper in this scenario would be appreciated.
Thanks.
3 Answer(s)
-
0
hi
However, when using the same mappings inside a service that derives from the ABP identity service:
Can you share some demo code and exception logs?
Thanks.
-
0
-
0
hi
Thanks. Can you also share some code of the mapper and your custom app service?
