Why is there an error Error 52 Argument 1: cannot convert from \'System.Collections.Generic.Dictionary>\' to \'System.Collections.Generic.IDictionary>\'
Dictionary<string, List<string>>
implements IDictionary<string, List<string>>
, while you're trying to cast it to IDictionary<string, *I*List<string>>
. It is not allowed, because IDictionary<string, IList<string>>
has e.g. the method Add
accepting instance of IList<string>
, while Add
method in your Dictionary<string, List<string>>
won't accept IList<string>
as its input.