I’m getting inconsistent accessibility error in the following declaration:
public static class Helper
{
public static void GetMyDictionary(Dictionary<string, string> dict)
{
dict = new Dictionary<string, string>();
// continue to do something
}
}
Anyone know which part of it is causing the error?
I ‘m going to go out on a limb here and say that the
Dictionaryclass this code refers to is not in factSystem.Collections.Generic.Dictionary, but some otherDictionarythat exists in your project. If the accessibility of this class is notpublic, the compiler will complain that you cannot expose to the world the methodGetMyDictionaryif one of its parameters is of a type not accessible to said world.If this is not the case, then the problem is somewhere else and not in the code you give.
In any case, posting the exact error message would help reduce the guessing.