dotnet · dotnet/KeyNotFoundException
KeyNotFoundException
KeyNotFoundException
Thrown when the key specified for accessing a dictionary element is not found. Use Dictionary.TryGetValue() or ContainsKey() to avoid the exception when the key may legitimately be absent.