title: Proper way to initialize a C# dictionary with values
body: <p>I am creating a dictionary in a C# file with the following code:</p>
  <pre><code>private readonly Dictionary&lt;string, XlFileFormat&gt; FILE_TYPE_DICT
          = new Dictionary&lt;string, XlFileFormat&gt;
          {
              {&quot;csv&quot;, XlFileFormat.xlCSV},
              {&quot;html&quot;, XlFileFormat.xlHtml}
          };
  </code></pre>
  <p>There is a red line under <code>new</code> with the error:</p>
  <blockquote>
  <p>Feature 'collection initilializer' cannot be used because it is not part of the ISO-2 C# language specification</p>
  </blockquote>
  <p>What is going on here?</p>
  <p>I am using .NET version 2.</p>