title: Downgrade .Net Core project from 3.1 to 2.2 - The type or namespace name 'IWebHostEnvironment' could not be found
body: <p>I had to downgrade a .Net Core 3.1 project that was scaffolded using:</p>
  
  <p><code>dotnet new angular -o my-new-app</code></p>
  
  <p>This should now be for .Net Core 2.2, Angular v8.</p>
  
  <p>I am now getting:</p>
  
  <blockquote>
    <p>error CS0246: The type or namespace name 'IWebHostEnvironment' could
    not be found (are you missing a using directive or an assembly
    reference?)</p>
  </blockquote>
  
  <p>This is on the line:</p>
  
  <p><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env)</code></p>
  
  <p>The auto-suggest fix options in Visual Studio 2019 are not helpful, as they are all "Generate Interface", nothing about a potential missing package.</p>
  
  <p>My using declarations on this class are as follows:</p>
  
  <pre><code>using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.SpaServices.AngularCli;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Hosting;`
  </code></pre>
  
  <p>These are all valid (unflagged) references.</p>
  
  <p>There are a slew of other errors also.  What am I missing here?</p>
  
  <p><a href="https://i.stack.imgur.com/lPEH5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lPEH5.png" alt="Errors after Downgrade"></a></p>
  
  <p><strong>Edit</strong></p>
  
  <p>The only reason I am even going this route is because I am unable to deploy to Azure using .Net Core 3.1, even though my App Service is set to use that version (LTS).</p>
  
  <blockquote>
    <p>The current .NET SDK does not support targeting .NET Core 3.1.  Either
    target .NET Core 2.2 or lower, or use a version of the .NET SDK that
    supports .NET Core 3.1.</p>
  </blockquote>
  
  <p>This is the error on the Azure server on the CI process.  The only information I've seen is that Microsoft is not fully ready for .Net Core 3.1 Azure CI, but I find that somewhat hard to believe.  For simplicity's sake I just want to downgrade to 2.2, which I know works fine with Azure, and meets the needs of my project.</p>
  
  <p>I deleted the App Service on Azure and re-created it as a .Net Core 2.2 App Service, hosted under Windows.  These other issues I am having is on the attempt to downgrade to 2.2 on my own machine.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Here are my current dependencies, all are showing 2.2 including the SDK.</p>
  
  <p><a href="https://i.stack.imgur.com/9fJbm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9fJbm.jpg" alt="Project Dependencies"></a></p>