title: Missing definition for TryAdd() in Dictionary
body: <p>I am using example from tutorial <a href="https://www.dotnetperls.com/dictionary" rel="nofollow noreferrer">https://www.dotnetperls.com/dictionary</a>
  But I have problems with missing reference to <code>TryAdd</code>. Should I add some extra references for using this method? I did not find anything in documentation <a href="https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.tryadd?view=net-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.tryadd?view=net-5.0</a></p>
  <pre><code>var items = new Dictionary&lt;string, int&gt;();
  // Part 1: add the string with value 1.
  bool result = items.TryAdd(&quot;test&quot;, 1);
  </code></pre>
  <blockquote>
  <p>Severity   Code    Description Project File    Line    Suppression State
  Error   CS1061  'Dictionary&lt;string, int&gt;' does not contain a definition for 'TryAdd' and no accessible extension method 'TryAdd' accepting a first argument of type 'Dictionary&lt;string, int&gt;' could be found (are you missing a using directive or an assembly reference?)  CsharpTest  C:\path\to\file\Program.cs  672 Active</p>
  </blockquote>
  <p><strong>UPDATE:</strong> This method is for .NET 5 ang greater (I am using older framework)</p>