Working with IWebHostEnvironment and IHostingEnvironment in dual targeted ASP.NET Core Projects

added by DotNetKicks
2/26/2020 3:34:05 PM

217 Views

In ASP.NET Core 3.x Microsoft introduced a new `IWebHostEnvironment` to replace the obsoleted `IHostingEnvironment`. While that works for top level applications this can cause some complications for multi-targeted libraries that need to support both .NET Core 2.x and 3.x. This post describes the problems and offers a few workarounds.


0 comments