Please see https://stackoverflow.com/a/58204848/3728901
Severity: Error
Error Code: CS0246
Description: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)
Project: foo
File: C:\Users\donhuvy\Desktop\acc133b3\foo\obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs
Line: 455
Suppression State: Active
Has @using at the top of file.
Compile project error.
.NET Core 3.0.100 , Visual Studio 2019
@HaoK - This is already fixed right? If so, can you please resolve this bug?
In .Net Core 3.1 I see same error.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?) LogicServices D:GitHubtyrchiksrcTyrchik.SiteLogicLayerLogicServicesUploadFileService.cs 15 Active
@deepchoudhery can you please take a look?
The new packages for 3.1 should have the issue fixed. What is the version of the package being used currently?
In .Net 5 and ASP.NET Core 5 same error
The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)
@HaoK - It is happening for me with DotNet Core version 3.1.405. Will you reopen this issue or should I create a new one?
After migration of ASP/DotNet Web App from 2.1 to 3.1
Program.cs
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost
.CreateDefaultBuilder(args)
.UseKestrel(options =>
{
if (isDevelopment)
{
options.Listen(IPAddress.Loopback, 5001);
options.Listen(IPAddress.Loopback, 44301, listenOptions =>
{
listenOptions.UseHttps(Environment.GetEnvironmentVariable("LOCAL_CERT_PFX_PATH"), "develop");
});
}
})
.UseSerilog()
.UseConfiguration(Configuration)
.UseStartup<Startup>();
}
It is not working in .Net 5. Please fix it. I'm using @using Microsoft.AspNetCore.Hosting
Most helpful comment
In .Net Core 3.1 I see same error.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?) LogicServices D:GitHubtyrchiksrcTyrchik.SiteLogicLayerLogicServicesUploadFileService.cs 15 Active