Activities of "pareeks@gccontractor.org"

  • Exception message and full stack trace: System.NullReferenceException: 'Object reference not set to an instance of an object.' source was null.
  • Steps to reproduce the issue: I recently upgraded an existing ABP.io project from .NET 9 to .NET 10. As part of the upgrade, ABP is moving from AutoMapper to Mapperly. After migrating an ABP application from AutoMapper to Mapperly, we are encountering numerous NullReferenceExceptions across the application during DTO mapping. The root cause is that AutoMapper implicitly handled null source navigation properties by skipping mapping or creating default values, whereas Mapperly is strict and assumes non-nullable mappings unless nullability is explicitly modeled.
  • Expected behavior A migration path similar to AutoMapper, where:
  • null source navigation properties are handled gracefully
  • Mapping either skips assignment or assigns default values
  • No runtime NullReferenceException occurs by default
  • Actual behavior
  • Mapperly generates mapping code that assumes non-nullable source objects
  • NullReferenceException is thrown when optional navigations are null
  • No global configuration option exists to preserve AutoMapper-style default handling
  • Question / Request Is there any global or framework-level configuration in ABP / Mapperly that allows:
  • Automatic handling of null source navigation properties
  • Default-value assignment or safe skipping (similar to AutoMapper)
  • Reducing the need to update hundreds of DTOs with explicit nullable annotations (?) If not, is there a recommended migration strategy from AutoMapper to Mapperly for large existing ABP applications that relied on AutoMapper’s implicit null-handling behavior?

Issue: AutoMapperMappingException after migrating from AutoMapper to Mapperly in ABP (.NET 9 → .NET 10)

Exception message and stack trace

AutoMapper.AutoMapperMappingException
HResult=0x80131500
Message=Missing type map configuration or unsupported mapping.
Source=AutoMapper
StackTrace: <Cannot evaluate the exception stack trace>

Steps to reproduce

  1. I upgraded an existing ABP.io project from .NET 9 to .NET 10.
  2. As part of the upgrade, ABP is moving from AutoMapper to Mapperly.
  3. I followed the official migration documentation:
  4. I converted all AutoMapper profiles to Mapperly mappers as per the documentation.

Observed behavior

  • When I use ObjectMapper.Map<TSource, TDestination>(), I get the AutoMapperMappingException shown above.
  • However, when I inject the generated Mapperly mapper directly into the consuming class and use it, the mapping works correctly.

Expected behavior

  • I would like to continue using ObjectMapper.Map (ABP’s abstraction) instead of injecting individual Mapperly mapper classes everywhere.

Question

  • How can I correctly configure or register Mapperly mappers so that ObjectMapper.Map works as expected in ABP?
  • Is there any additional setup required to make ObjectMapper resolve Mapperly-based mappers instead of falling back to AutoMapper?
Showing 1 to 2 of 2 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on January 22, 2026, 11:30
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.