title: can't find IWebHostEnvironment in Microsoft.AspNetCore.Hosting.Abstractions assembly in a .NET Core class library
body: <p>I can't reference the IWebHostEnvironment element in my .NET Core class library. I have added NuGet packages <strong>Microsoft.AspNetCore.Hosting.Abstractions</strong> and <strong>Microsoft.Extensions.DepedencyInjection.Abstractions</strong>, but it still can't find the type.
  In the documentation, <em>IWebHostEnvironment</em> is in the Microsoft.AspNetCore.Hosting.Abstractions assembly, but I can't seem to reference the correct assembly.</p>
  <p>Is there any other assembly I need to reference?</p>
  <p><strong>Project file</strong>:</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
      &lt;RootNamespace&gt;LundbeckConsulting.Components.Core&lt;/RootNamespace&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Hosting.Abstractions&quot; Version=&quot;2.2.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.EntityFrameworkCore&quot; Version=&quot;3.1.6&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Extensions.DependencyInjection.Abstractions&quot; Version=&quot;3.1.6&quot; /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;ProjectReference Include=&quot;..\LC.Components\LC.Components.csproj&quot; /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>