Random Crashes "KeyNotFoundException"

I’m getting some apparently random crashes with this output:

‘A first chance exception of type ‘System.Collections.Generic.KeyNotFoundException’ occurred in mscorlib.ni.dll’

For the same part of the game, sometimes it will crash with this output and other times it will pass just fine.
Anyone knows what this is?

Hi,

did you try enabling debug break on exceptions in VS and checking the stacktrace where exactly it is happening? To enable exceptions, go to Debug → Exceptions and tick the checkboxes on “CLR exceptions”.