Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error When Using GetOwnedGames on MacOS #130

Open
alexp9982 opened this issue Aug 7, 2022 · 2 comments
Open

Error When Using GetOwnedGames on MacOS #130

alexp9982 opened this issue Aug 7, 2022 · 2 comments

Comments

@alexp9982
Copy link

When using MacOS (On Windows, the exact code works just fine), when attempting to use the GetOwnedGamesAsync method, the method fails and shoots an AutoMapper error. Here is the error stack:

AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
OwnedGamesResult -> OwnedGamesResultModel
SteamWebAPI2.Models.SteamPlayer.OwnedGamesResult -> Steam.Models.SteamCommunity.OwnedGamesResultModel

Type Map configuration:
OwnedGamesResult -> OwnedGamesResultModel
SteamWebAPI2.Models.SteamPlayer.OwnedGamesResult -> Steam.Models.SteamCommunity.OwnedGamesResultModel

Destination Member:
OwnedGames

 ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.List`1.Enumerator[[SteamWebAPI2.Models.SteamPlayer.OwnedGame, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]].MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator[[SteamWebAPI2.Models.SteamPlayer.OwnedGame, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at System.Linq.Expressions.Interpreter.FuncCallInstruction`2[[System.Collections.IEnumerator, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   --- End of inner exception stack trace ---
   at System.Linq.Expressions.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] arguments)
   at SteamWebAPI2.Mappings.PlayerServiceProfile.<>c.<.ctor>b__0_8(OwnedGamesResultContainer src, OwnedGamesResultModel dest, ResolutionContext context)
   at System.Linq.Expressions.Interpreter.FuncCallInstruction`5[[System.Func`4[[SteamWebAPI2.Models.SteamPlayer.OwnedGamesResultContainer, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[AutoMapper.ResolutionContext, AutoMapper, Version=11.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005],[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[SteamWebAPI2.Models.SteamPlayer.OwnedGamesResultContainer, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[AutoMapper.ResolutionContext, AutoMapper, Version=11.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005],[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] arguments)
   at SteamWebAPI2.Mappings.SteamWebResponseProfile.ConstructSteamWebResponse[OwnedGamesResultContainer,OwnedGamesResultModel](ISteamWebResponse`1 response, ResolutionContext context)
   at SteamWebAPI2.Mappings.SteamWebResponseProfile.<CreateSteamWebResponseMap>b__2_0[OwnedGamesResultContainer,OwnedGamesResultModel](ISteamWebResponse`1 src, ISteamWebResponse`1 dest, ResolutionContext context)
   at System.Linq.Expressions.Interpreter.FuncCallInstruction`5[[System.Func`4[[SteamWebAPI2.Utilities.ISteamWebResponse`1[[SteamWebAPI2.Models.SteamPlayer.OwnedGamesResultContainer, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[SteamWebAPI2.Utilities.ISteamWebResponse`1[[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[AutoMapper.ResolutionContext, AutoMapper, Version=11.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005],[SteamWebAPI2.Utilities.ISteamWebResponse`1[[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[SteamWebAPI2.Utilities.ISteamWebResponse`1[[SteamWebAPI2.Models.SteamPlayer.OwnedGamesResultContainer, SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[SteamWebAPI2.Utilities.ISteamWebResponse`1[[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null],[AutoMapper.ResolutionContext, AutoMapper, Version=11.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005],[SteamWebAPI2.Utilities.ISteamWebResponse`1[[Steam.Models.SteamCommunity.OwnedGamesResultModel, Steam.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], SteamWebAPI2, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null]].Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] arguments)
   at SteamWebAPI2.Interfaces.PlayerService.GetOwnedGamesAsync(UInt64 steamId, Nullable`1 includeAppInfo, Nullable`1 includeFreeGames, IReadOnlyCollection`1 appIdsToFilter)
   at SteamCompare.ViewModel.ListPageViewModel.GetResults() in /Users/alexp/Projects/SteamCompare/SteamCompare/ViewModel/ListPageViewModel.cs:line 101

The full source code is open source, and is available on my profile, or using the link here.

Is this issue possible to solve on your end or is this an AutoMapper problem?

@babelshift
Copy link
Owner

What version of AutoMapper are you using?

@alexp9982
Copy link
Author

At the time I had tried 10.1.1, 11.0.0, and 11.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants