Error after upgrading from ASP MVC 3 Beta to RC

After I upgraded the ASP MVC 3 application from beta to the candidate for realease, I encountered this error:

{"Method not found: 'Void System.Web.Mvc.GlobalFilterCollection.Add(System.Object, System.Nullable`1<Int32>)'."}

The error is Global.asaxinside this code:

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters); // <-- Here
        RegisterRoutes(RouteTable.Routes);
    }

Here is my RegisterGlobalFilters()

    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
    }

Here are the details of my System.Web.MVC.dll: alt text

The System.Web.MVC.dll file is actually missing from the build folder, should it be here? alt text

Here is a screenshot of all the MVC applications installed on my computer, the beta version was not programmed before I did a new RC installation, I also installed it through the Microsoft Web Platform installer, so I think everything should be fine: alt text

Anyone got it?

+3
source share
3 answers

RC System.Web.Mvc.dll Reflector, private void AddInternal(object filter, int? order). , - Add.

RC 3.0.11029.0. dll, C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies, / -, dll.

:

ASP.NET MVC 3 RC ASP.NET MVC 3 Preview 1 ASP.NET MVC 3 Beta.

, -, -, RC -, RC.

+1

RegisterGlobalFilters ASP.NET MVC 3 RC:

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
    filters.Add(new HandleErrorAttribute());
}

? , (a Nullable<int>) Add.

0

Make sure you have the correct version of System.Web.Mvc.dll on the test machine. Ff MVC 3 Beta is installed in the GAC, then it will always win, even if you have the RC version in the bin folder of the application. Try to figure out which directory your dll is loading from.

0
source

Source: https://habr.com/ru/post/1778149/


All Articles