title: AuthenticationBuilder does not contain a definition for AddAzureAd
body: <p>Im following a tutorial from <a href="https://www.c-sharpcorner.com/article/authentication-and-authorization-in-asp-net-core-2-0-using-azure-active-director/" rel="noreferrer">here</a> and trying to enable OpenId Connect using Azure Ad and here's the code that I am trying to add to the Startup.cs file. </p>
  
  <pre><code>    services.AddAuthentication(sharedOptions =&gt;
          {
              sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
              sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
          })
          .AddAzureAd(options =&gt; Configuration.Bind("AzureAd", options))
          .AddCookie();
  </code></pre>
  
  <p>But it has red underline for <code>AddAzureAd</code> and shows this error message:</p>
  
  <blockquote>
    <p>'AuthenticationBuilder' does not contain a definition for 'AddAzureAd'
    and no accessible extension method 'AddAzureAd' accepting a first
    argument of type 'AuthenticationBuilder' could be found (are you
    missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Steps I have tried:</p>
  
  <ol>
  <li>Clean and rebuild the solution</li>
  <li>restart visual studio</li>
  </ol>
  
  <p>But it doesnt fix the issue. Anyone knows what's the other reason that causes this?</p>