title: .NET Core 2.1: AddHsts() and AddHttpsRedirection() not defined
body: <p>I have a .NET Core 2.1 application and want to use HTTPs according to <a href="https://docs.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-2.1" rel="nofollow noreferrer">this</a> article. So I added</p>
  <pre><code>services.AddHsts(options =&gt;
  {
      options.MaxAge = TimeSpan.FromDays(60);
  });
  services.AddHttpsRedirection(options =&gt;
  {
      options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect;
      options.HttpsPort = 5001;
  });
  </code></pre>
  <p>to the <code>ConfigureServices(...)</code> method and</p>
  <pre><code>app.UseHsts();
  app.UseHttpsRedirection();
  </code></pre>
  <p>to the <code>Configure(...)</code> method. I checked the namespace of the methods and they should be present in Microsoft.AspNetCore.Builder (<a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.hstsbuilderextensions.usehsts?view=aspnetcore-2.1" rel="nofollow noreferrer">e.g. UseHsts()</a>), but all of them generate the compiler error</p>
  <blockquote>
  <p>'IApplicationBuilder' does not contain a definition for 'UseHsts' and no accessible extension method 'UseHsts' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  <p>or</p>
  <blockquote>
  <p>'IServiceCollection' does not contain a definition for 'AddHttpsRedirection' and no accessible extension method 'AddHttpsRedirection' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  <p><strong>Am I missing a <code>using</code> directive or a specific NuGet package? How can I use those methods?</strong></p>