Hello, I'm getting this error: Hashtable insert failed. Load factor too high. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Hashtable insert failed. Load factor too high.
In my code I look for a key in a Dictionary if it's not there I add it. After some research I think the error above is because I'm trying to add the same key twice.
static Dictionary<string, string> settings =
new Dictionary<string, string>();
if ((!settings.ContainsKey(Key)) || (settings[Key] == null))
settings.Add(Key, AltValue);//Changes by Reliance Consulting
Is there a safer way to do this?
thanks!