HttpContext not available in Class Library

Boardy picture Boardy · Jan 4, 2013 · Viewed 33.5k times · Source

I am working on a project where I have a C# class library which needs to use the System.web.HttpContext. I've done this before in another project without problem but now its not working. I'm not sure what I am missing they're both targeting .net 3.5 and I've added the reference System.web and added the directive using System.web.

However, when I try and do HttpContext nothing is found. I've tried using the full path System.web.HttpContext but the only thing that comes up are 3 items related to ASP.

Below are screenshots from the working project intellisense and the non-working intellisense

Below is the working screenshot

working screenshot

and below is the non working screenshot

not working screenshot

Thanks for any help you can provide

Answer

competent_tech picture competent_tech · Jan 4, 2013

This means that either you are using a Client Profile as the Target Framework or the reference to System.Web was not added correctly.