You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stackoverflow on upgrade of AutoMapper.Extensions.Microsoft.DependencyInjection #153
TLDR See whole chain of comments. It looks to be caused by AutoMapper.Extensions.Microsoft.DependencyInjection.
I'm getting a SO in Visual Studio when my WebApp starts up. I have extensive usage of Automapper, but I get nothing other that a SO. The call stack is:
I've grabbed all of the source code to help debug. It seems to be stumbling (in a recursive way) when calling EquivalentExpressionAddRemoveCollectionMapper.MapExpression(...) for
.ForMember(d => d.Errors, o => o.MapFrom((s, d) => s.Errors?.Split(';')));
changed the title [-]Stackoverflow on upgrade to .net 5[/-][+]Stackoverflow on upgrade of AutoMapper.Extensions.Microsoft.DependencyInjection[/+]on Nov 14, 2020
Activity
penfold commentedon Nov 12, 2020
When I comment out AM.Coll, the SO does not occur.
services.AddAutoMapper(configurationExpression =>
{
//configurationExpression.AddCollectionMappers();
},
typeof(MapperFactoryExtensions).Assembly);
penfold commentedon Nov 12, 2020
Upgrading from AM 9.0.0 to 10.1.1 and AM.Coll 6.0.0 to 7.0.0. (And .net core 3.1 to .net 5)
penfold commentedon Nov 13, 2020
Is it possible have some exception handling in that stack to get feedback on which types are causing the issue?
penfold commentedon Nov 13, 2020
I've grabbed all of the source code to help debug. It seems to be stumbling (in a recursive way) when calling EquivalentExpressionAddRemoveCollectionMapper.MapExpression(...) for
.ForMember(d => d.Errors, o => o.MapFrom((s, d) => s.Errors?.Split(';')));This is string[] to IList<string> .
penfold commentedon Nov 14, 2020
I've tested my .net core 3.1 branch with the latest versions of AM and AM.Coll. This looks to be working correctly.
I then updated AutoMapper.Extensions.Microsoft.DependencyInjection and the SO is now seen.
[-]Stackoverflow on upgrade to latest version[/-][+]Stackoverflow on upgrade to .net 5[/+][-]Stackoverflow on upgrade to .net 5[/-][+]Stackoverflow on upgrade of AutoMapper.Extensions.Microsoft.DependencyInjection[/+]TylerCarlson1 commentedon Nov 15, 2020
Seems very similar to #151. Preserve References is not getting used and goes into SO loop.
You can try updating to 7.0.1-ci-00105 from nuget feed AM-prerelease and see if that fixes your problem
gokhanabatay commentedon Nov 18, 2020
Same issue with .net 5.0 AutoMapper 10.1.1, AutoMapper.Collection 7.0.0, AutoMapper.Extensions.Microsoft.DependencyInjection 8.1.0
esabah commentedon Nov 18, 2020
I am getting error with
.net 5.0 , AutoMapper 10.1.1, AutoMapper.Collection 7.0.0, AutoMapper.Extensions.Microsoft.DependencyInjection 8.1.0.
I tried AutoMapperCollection 7.0.1-ci-00105 and worked without errors.
When do you plan to release this fix? Thanks.
TylerCarlson1 commentedon Nov 18, 2020
When I fix the deployment pipeline to nuget which has changed to GitHub Actions from AppVoyer
TylerCarlson1 commentedon Nov 23, 2020
Got it pushed fix is in 7.0.1
rcdailey commentedon Sep 24, 2023
I'd just like to point out that I'm getting this exact same issue. I'm running AutoMapper v12.0.1 and AutoMapper.Collection v9.0.0.