Error registering global filter on MVC 3 RC

I have an mvc 3 web application, but my joint web hosting company only supports MVC 2. So I also deploy mvc 3 related dll files and it worked well on the server until it was a mvc beta 3.

Yesterday I upgraded my pc environment to mvc 3 RC and rebuilt my web application. The application works well on my local computer, but when I deploy and run on the hosting server, it makes an error.

[MissingMethodException: Method not found: 'Void System.Web.Mvc.GlobalFilterCollection.Add(System.Object)'.]
Myweb.MvcApplication.RegisterGlobalFilters(GlobalFilterCollection filters) in c:\my\Global.asax.cs:18
Myweb.MvcApplication.Application_Start() in c:\my\Global.asax.cs:36

As you can see, when I try to register a global filter in global.asax, it says that it cannot find the Mvc.GlobalFilterCollection.Add (object) method.

If I do not register any global filter, the entire web server works well on the hosting server.

How can I solve this error?

edit: It seems that the mvc3 beta is registered in the GAC of the hosting server. They said no, but I checked the location of the System.Web.Mvc.dll reference in my application.

+5
source share
1 answer

From your description, it looks like you have mksmatch between the version of MVC 3 that you use on your computer and the version downloaded to your server. We changed the settings for GlobalFilterCollection.Add, and it looks like you are compiling your application on your PC using MVC 3 RC, however you are deploying it on a server with a beta version of MVC 3. Make sure that the version of System.Web.Mvc.dll is correct on your server .

: Eilon, MVC 3 Beta GAC, , RC bin .

+5

All Articles