Skip to content

Custom value Resolvers are broken after migrating to v16 #4598

@majorimi

Description

@majorimi

We are using AutoMapper for several years... We also bought the bundle license for it. Previously used custom Resolvers without any issues like mentioned here in v14.x
After updating to v16 we applying license, then fixed all build errors.

But now we have runtime errors:

  • First the resolvers were not found, we had to update the Service registration to just specify the implementation not the interface: services.AddTransient<CanDeleteAnnouncementResolver>(); Also previously some resolvers were not even registered. Registered all of them...

  • After changing the Service registrations now we have some resolvers mapping issues:

  HResult=0x80131500
  Message=Error building queryable mapping strategy.
  Source=AutoMapper
  StackTrace:
<Cannot evaluate the exception stack trace>

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
AutoMapperMappingException: Unable to create a map expression from . (Iaea.Usie.DataModel.Models.Announcement) to Boolean.CanDelete (System.Boolean)

However we have a few more Resolvers for few other types of objects. Mostly running totally similar validation to for CanDelete/edit/view etc. And some of them working some of them not... But registration, usage and implementation is the same...

It might be also important we updated the project from .NET 8 to .NET 10 and switched to VS 2026.

What can be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions