Problems with references and MVC

0

I have a project where it works. I needed to create another project elsewhere and I was enjoying what I already have. It turns out that it is giving an error in base.Initialize (...) saying that it does not recognize this face. I put the same using the other project, that is, ctrl + c and ctrl + v and nothing else. Below my methods

protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {

            requestContext.HttpContext.Response.Buffer = true;
            requestContext.HttpContext.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            requestContext.HttpContext.Response.Expires = 0;
            requestContext.HttpContext.Response.CacheControl = "no-cache";
            requestContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            string strPaginaAtual = requestContext.HttpContext.Request.CurrentExecutionFilePath;
            strPaginaAtual = strPaginaAtual.Remove(0, strPaginaAtual.LastIndexOf("/") + 1);

            base.Initialize(requestContext);

        }

        protected override void OnException(ExceptionContext filterContext)
        {

            base.OnException(filterContext);
        }

and my usings:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;

I was compiling and gave this error:

Error   1   'V99Util.WebPageBase.Initialize(System.Web.Routing.RequestContext)': no suitable method found to override
    
asked by anonymous 22.04.2014 / 20:39

1 answer

2

The message no suitable method found to override indicates that in the ancestor class there is no Initialize method that is virtual with the arguments used in the method of the child class.

In this case, your class needs to be implemented with the following statement:

public abstract class WebPageBase : System.Web.Mvc.Controller
    
22.04.2014 / 21:01