AutoMapper 8 Upgrade ConstructUsing

Viewed 2190

I have just upgraded to v8 of AutoMapper and the expression below fails but I really cannot see why.

cfg.CreateMap<string, Nmtoken>()
    .ConstructUsing(i => new Nmtoken(i))                
    .ForMember(m => m.Token, o => o.MapFrom(s => s));

I believe that the passed expressions are valid. I get no build errors and intellisense is happy. But I get runtime error:

System.MissingMethodException: 'Method not found: 
'AutoMapper.IMappingExpression`2<!0,!1> 
AutoMapper.IMappingExpression`2.ConstructUsing(System.Func`2<!0,!1>)'.'

I'm happy to admit that I don't understand the error message.

2 Answers

Apologies. I have two projects linked with a dependency and one of them was still using AutoMapper 7.

I had the samme issue, but i was using AutoMapper v8.0.0. Upgrading to version v8.1.0 solved the issue.

Related