Last post Nov 01, 2020 06:33 PM by JORGEMAL
Oct 31, 2020 10:21 PM|JORGEMAL|LINK
I have been trying to use IWebHostEnvioronment instead of
IHostingEnvironment. I have read several posts about how to fix this issue without success. What I have seen is that, supposedly, I only need to add the
Microsoft.AspNetCore.Hosting namespace (and its reference of course which I've got from NuGet) and this would solve my trouble. I did this already but I am still facing the problem. The following code shows all the namespaces I reference in
In the code blow, a red kind of line appears below the IWebHostEnvironment type for the
env parameter saying that "The type or namespace 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)"
public async Task Invoke(HttpContext context, IWebHostEnvironment env)
// Some code here.
I will very much appreciate yhour feedback.
Oct 31, 2020 10:24 PM|PatriceSc|LINK
You are using ASP.NET Core 3.0 or later?
Oct 31, 2020 10:26 PM|JORGEMAL|LINK
My Target Framework is .NET Core 3.1
Nov 01, 2020 06:33 PM|JORGEMAL|LINK
After searching and searching for a solution I found this linkk that solved my issue: