Hi,
I create a class which implement AuthorizeAttribute Interface with override method HandleUnauthorizedRequest in mvc core.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; using IdentityTest.DBModel; namespace IdentityTest.CustomFolder { public class CustomErrorTexelMobile: AuthorizeAttribute { protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) { using (MobileEntities db = new MobileEntities()) { var res = db.SelfServeAdmins.FirstOrDefault(sid => sid.MobileSignOnEnabled == true); if (res == null) { filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new {controller = "PermissionError", action = "AccessDenied"})); } } } } }
Compile Time error: Error CS7069 Reference to type 'RouteValueDictionary' claims it is defined in 'System.Web', but it could not be found
How can to slove this issue. Which namespace necessary for MVC Core against This issue.