EfCore.GenericServices icon indicating copy to clipboard operation
EfCore.GenericServices copied to clipboard

Not compatible with Automapper 11.0.0

Open Akku-21 opened this issue 3 years ago • 5 comments

Hi there,

I just wanted to let you know, that your latest release 5.1.1 is not compatible with Automapper v 11.0.0.

regards Jan

Akku-21 avatar Feb 03 '22 10:02 Akku-21

What do you mean by "...not compatible with Automapper v 11.0.0"? Does it no compile, or fails when used?

JonPSmith avatar Feb 03 '22 10:02 JonPSmith

It compiles but throws in service registration with a Method not found: 'Void AutoMapper.Profile.ForAllPropertyMaps... Exception.

regards Jan

Akku-21 avatar Feb 03 '22 10:02 Akku-21

Difficult - AuthoMapper 11.0.0. doesn't support net6 - see this.

Not going to look at that for a while, so use AuthMapper 10.1.1 for now.

JonPSmith avatar Feb 03 '22 11:02 JonPSmith

Another note to anyone researching this issue. I had upgraded from AutoMapper.Data from version 5.0.0 to 6.0.0 that brings AutoMapper 11.0.1 along with it. Same issue as above.

The following call fails: services.ConfigureGenericServicesEntities(new Type[] { ... }).ScanAssemblesForDtos( ... ).RegisterGenericServices();

System.MissingMethodException HResult=0x80131513 Message=Method not found: 'Void AutoMapper.Profile.ForAllPropertyMaps(System.Func2<AutoMapper.PropertyMap,Boolean>, System.Action2<AutoMapper.PropertyMap,AutoMapper.IMemberConfigurationExpression>)'. Source=GenericServices StackTrace: at GenericServices.Setup.Internal.MappingProfile..ctor(Boolean addIgnoreParts) at GenericServices.Setup.Internal.SetupDtosAndMappings..ctor(IGenericServicesConfig publicConfig) at GenericServices.Setup.ConfigureGenericServices.ScanAssemblesForDtos(IGenericServicesSetupPart1 setupPart1, Assembly[] assembliesToScan) at ... .Startup.ConfigureServices(IServiceCollection services) in C:\ ... \Startup.cs:line ...

Jerrill avatar Jul 18 '22 20:07 Jerrill

I just dropped in a PR that resolves this issue.

Jerrill avatar Jul 18 '22 21:07 Jerrill

Hi @Jerrill,

Sorry I missed your comment / PR - I must have been busy around the time an missed this. Sorry about that.

I will updating all my libraries to support NET7 and I will try your PR and see how it goes.

JonPSmith avatar Oct 19 '22 07:10 JonPSmith

Hi @Jerrill,

Version 5.2.0 of this library is out with your PR. Thanks for your help.

JonPSmith avatar Nov 15 '22 09:11 JonPSmith