none
Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly System.Web RRS feed

  • Question

  • Hello all,

    I'm developing a ASP.NET Core (2.0) Web Api application and when I try to execute this instruction, in DAL project (class library):

    string pathApplication = System.Web.Hosting.HostingEnvironment.MapPath("~/Template");

    I receive the following error:

    System.TypeLoadException
      HResult=0x80131522
      Message=Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    Can someone help me?

    Best

    Stefano

    Wednesday, May 15, 2019 5:25 PM

All replies