title: How to import Microsoft.AspNetCore.Hosting.IWebHostEnvironment?
body: <p>The following code in my project gets the following error.</p>
  
  <pre><code>public static IServiceCollection AddInfrastructure(this IServiceCollection services, 
    IConfiguration configuration, 
    Microsoft.AspNetCore.Hosting.IWebHostEnvironment environment) // Error
  {
      //    .....
      return services;
  }
  </code></pre>
  
  <blockquote>
    <p>Error  CS0234  The type or namespace name 'IWebHostEnvironment' does not exist in the namespace 'Microsoft.AspNetCore.Hosting' (are you missing an assembly reference?)    </p>
  </blockquote>
  
  <p>I already import the nuget package.</p>
  
  <pre><code>  &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0" /&gt;
    &lt;/ItemGroup&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NTA1S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NTA1S.png" alt="enter image description here"></a></p>