Ema.H Ema.H - 1 year ago 110
C# Question

Can not access to HttpContext.Current

I can't access to HttpContext.Current on my project MVC4 with C#4.5

I ve added my reference to System.Web in my project and add the using instruction on my controller page...

But i can acces currentHandler only...

var context = HttpContext.CurrentHandler; //Current

deprecated on C#4.5 ?

I ve looked this help page : http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx

Answer Source

Have you included the System.Web assembly in the application?

using System.Web;

If not, try specifying the System.Web namespace, for example:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download