locked
Unknown type HttpContextWrapper RRS feed

  • Question

  • User65893105 posted

    Im getting an ide error

    Unknown type HttpContextWrapper

    but Im using and referencing system.web  (.net 3.5)

    var context = new HttpContextWrapper(System.Web.HttpContext.Current);

    bit confused as to why, anyone help ?

    Friday, July 4, 2014 5:41 AM

Answers

All replies

  • User-1360095595 posted

    In .net 3.5 it's in System.Web.Abstractions.dll.

    Refer: http://msdn.microsoft.com/en-us/library/system.web.httpcontextwrapper(v=vs.90).aspx

    Edit: in case it's not clear, you need to add a reference to this dll.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 4, 2014 5:43 AM
  • User65893105 posted

    That worked thanks, I have another problem though

    var context = new HttpContextWrapper(System.Web.HttpContext.Current);

    var routeData = RouteTable.Routes.GetRouteData(context);

    routeData is null despite being able to see all the routes available in the route table, any idea why that could be ?

    Friday, July 4, 2014 6:39 AM
  • User-1360095595 posted

    Please create a new thread with this issue since it's different from the original one. 

    Friday, July 4, 2014 11:40 AM