2

I'm developing a .NET Standard 2.0 class library in Visual Studio 2017 15.5 which at some point tries to call a Web Service. The way to authenticate is by using WSE 3.0 (Microsoft.Web.Services3).

Before the call, it crashes executing this instruction:

UsernameToken userToken = new UsernameToken(sUser, sPass, PasswordOption.SendHashed);

The error is:

Could not load type 'System.Web.HttpContext' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Does System.Web.HttpContext exist in .NET Standard? How can I solve this?

SySc0d3r
  • 652
  • 1
  • 6
  • 18
  • add a reference to System.Web. make sure you choose version 4.0 – Steve Dec 07 '17 at 15:56
  • 4
    It doesn't appear in the assemblies list from the references' manager. I even tried to add the reference from the .dll file with no success. – SySc0d3r Dec 07 '17 at 16:01
  • 1
    Possible duplicate of [HttpContext in .net standard library](https://stackoverflow.com/questions/47357689/httpcontext-in-net-standard-library) – desmondgc Dec 22 '17 at 14:39

0 Answers0