As stated in https://github.com/NLog/NLog/issues/2228#issuecomment-325226959 - I met with very similar issue as #2228 on latest NLog V5 beta09 version specifically in .NET Core 2.0 app. The stack trace recorded for that exception was:
2017-08-27 15:12:15|ArchiSteamFarm-6352|FATAL|ASF|OnUnhandledException() System.ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.ValueCollection.CopyTo(TValue[] array, Int32 index)
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at NLog.LogFactory.LoggerCache.GetLoggers()
at NLog.LogFactory.ReconfigExistingLoggers()
at ArchiSteamFarm.Program.GetUserInput(EUserInputType userInputType, String botName) in C:\projects\archisteamfarm\ArchiSteamFarm\Program.cs:line 84
at ArchiSteamFarm.Bot.InitLoginAndPassword(Boolean requiresPassword) in C:\projects\archisteamfarm\ArchiSteamFarm\Bot.cs:line 1252
at ArchiSteamFarm.Bot.<OnConnected>d__136.MoveNext() in C:\projects\archisteamfarm\ArchiSteamFarm\Bot.cs:line 1526
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
I believe this is the same issue, therefore https://github.com/NLog/NLog/pull/2229 should be forwarded into V5 branch.
I'd appreciate if next version shipped with that fix, as original issue was marked as "must have" and it's rather important bugfix. Even if current state of V5 is not suitable for a release, I'd appreciate a lot beta10 which could be simply beta09 + fix in. Of course, I don't have a say in this, I just share my opinion.
Thank you in advance.
thanks for the issue report!
I have made a PR, but there are many conflicts. (https://github.com/NLog/NLog/pull/2268)
If you have time, could you help us in fixing the merge conflicts? (the project files are easy to fix, as they are removed in NLog 5). Just create another PR if you like, thanks!
@304NotModified Have now created a cherry pick for you at #2269
Thanks @snakefoot !!
Will be beta10. CI is running now
Beta10 is live now: https://www.nuget.org/packages/NLog/5.0.0-beta10
Thank you! 馃挀