question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing type map configuration or unsupported mapping in Abp version 4.8.0

See original GitHub issue

In the .Net core project, the Abp version was 4.6.0, the Automapper didn’t have any mapping problem with mentioned classes but after updated to Abp version 4.8.0 the following error had occurred:

Error:

Missing type map configuration or unsupported mapping.
Mapping types:
HotelbedsAvailabilityByGeolocationInputDto -> HotelbedsAvailabilityByGeolocationRequest
CompanyName.Project.InternationalServices.Dto.HotelbedsAvailabilityByGeolocationInputDto -> CompanyName.Project.InternationalServices.HotelbedsAvailabilityByGeolocationRequest
   at lambda_method(Closure , HotelbedsAvailabilityByGeolocationInputDto , HotelbedsAvailabilityByGeolocationRequest , ResolutionContext )
   at lambda_method(Closure , Object , Object , ResolutionContext )
   at AutoMapper.Mapper.AutoMapper.IMapper.Map[TDestination](Object source) in C:\projects\automapper\src\AutoMapper\Mapper.cs:line 212
   at CompanyName.Project.InternationalServices.HotelbedsUnitAppService.AvailabilityByGeolocationCodeAsync(HotelbedsAvailabilityByGeolocationInputDto hotelbedsAvailabilityByGeolocationInputDto) in D:\Projects\Hub\src\CompanyName.Project.Application\Services\International\HotelBeds\HotelbedsUnitAppService.cs:line 53
   at lambda_method(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

Classes:

public class HotelbedsAvailabilityByGeolocationInputDto : HotelbedsAvailabilityBaseDto
{
    public GeolocationDto geolocation { get; set; }
}
public abstract class HotelbedsAvailabilityBaseDto
{
    public StayDto stay { get; set; }
    public OccupancyDto[] occupancies { get; set; }
    public override string ToString()
    {
        return $"stay.checkIn is: {stay.checkIn} and stay.checkOut is {stay.checkOut}";
    }
}
public class GeolocationDto
{
    public float latitude { get; set; }
    public float longitude { get; set; }
    public int radius { get; set; }
    public string unit { get; set; }
}
public class HotelbedsAvailabilityByGeolocationRequest : HotelbedsAvailabilityBase
{
    public Geolocation geolocation { get; set; }
}
public abstract class HotelbedsAvailabilityBase
{
    public Stay stay { get; set; }
    public Occupancy[] occupancies { get; set; }
    public override string ToString()
    {
        return $"stay.checkIn is: {stay.checkIn} and stay.checkOut is {stay.checkOut}";
    }
}
public class Geolocation
{
    public float latitude { get; set; }
    public float longitude { get; set; }
    public int radius { get; set; }
    public string unit { get; set; }
}
public class StayDto
{
    public string checkIn { get; set; }
    public string checkOut { get; set; }
}
public class OccupancyDto
{
    public int rooms { get; set; }
    public int adults { get; set; }
    public int children { get; set; }
}

In the CustomDtoMapper file:

configuration.CreateMap<HotelbedsAvailabilityByGeolocationRequest, HotelbedsAvailabilityByGeolocationInputDto>();

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:30 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
EmmyGuycommented, Jul 22, 2020

@amendez1000, You just saved me from hours of troubles… this: [AutoMapFrom(typeof(Branch))] public class CreateBranchDto : FullAuditedEntityDto

To

[AutoMapTo(typeof(Branch))] public class CreateBranchDto : FullAuditedEntityDto

did the trick for me

1reaction
BeelineDeveloperscommented, Sep 25, 2019

I have the appropriate CreateMap calls (like I did prior to updating to v7.2.3) and am also running into the same error. CustomDtoMapper received minimal changes, but the code looks like it should be supported (didn’t change the way mappings work that I can see).

Visited here and didn’t notice anything I’m not already doing (any calls to ObjectMapper.Map should have all the mappings configured) - any other ideas on what to check?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing type map configuration or unsupported mapping ...
ABP Framework version: 4.1.1 UI type: MVC DB provider: EF Core **Tiered (MVC) Exception message and stack trace:AutoMapperMappingException: ...
Read more >
NET Core AutoMapper missing type map configuration or ...
I get below error in auto mapper. AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping. can someone help ...
Read more >
Missing type map configuration or unsupported mapping
Hello guys, in this video we will learn about how to solve error Missing type map configuration or unsupported mapping in asp.net mvc....
Read more >
AutoMapper Exception: Missing type map configuration or ...
Coding example for the question AutoMapper Exception: Missing type map configuration or unsupported mapping-.net-core.
Read more >
دلیل خطای Missing type map configuration or unsupported ...
Missing type map configuration or unsupported mapping. کلاس یا جدول CourseSection. public class CourseSection { [Key] public int ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found