I'm trying to create a UrlHelper as follows:
UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
I have already made reference to System.Web
, as I saw it as a solution in several places.
using System.Web;
The strange thing about this using is gray (Visual Studio 2015) which shows that it is not even using this reference.
The error is:
Error CS1061 'HttpContextBase' does not contain a definition for 'Current' and no extension method 'Current' accepting a first argument of type 'HttpContextBase' could be found (are you missing a using directive or an assembly reference?)