<p>How to declare a static dictionary object inside a static class? I tried</p>

<pre><code>public static class ErrorCode
{
    public const IDictionary&lt;string, string&gt; ErrorCodeDic = new Dictionary&lt;string, string&gt;()
    {
        { "1", "User name or password problem" }     
    };
}
</code></pre>

<p>But the compiler complains that "<em>A const field of a reference type other than string can only be initialized with null</em>". </p>

```
```
public static class ErrorCode
{
    public const IDictionary<string , string > m_ErrorCodeDic;

    public static ErrorCode()
    {
      m_ErrorCodeDic = new Dictionary<string, string>()
             { {"1","User name or password problem"} };             
    }
}
```
```
Probably initialise in the constructor.