开发者

asp.net mvc 2 method not found

When I run my asp.net mvc 2 site (shared hosting) I get the following error:

Method not found: 'Void System.Web.Mvc.DataAnnotationsModelValidatorProvider.
set_AddImplic开发者_运维知识库itRequiredAttributeForValueTypes(Boolean)'. 

In the bin directory I have System.Web.Mvc.dll version 2.0.50217.0

On my local dev machine it runs fine.

Is it possible that if the hosting provider has a different mvc 2 version installed it would cause this error?


The official System.Web.Mvc is version 2.0.0.0. It seems that you are using some custom built version - 2.0.50217.0 that might be missing this method. Try deploying your application without the assembly in the bin folder.


I think a better way would be to copy the ASP.NET MVC 2 dll into your code directory(where ever you put your dependencies) and reference it from there. This way you can avoid this type of errors if the hosting machine doesn't have ASP.NET MVC 2 installed on it.


Thanks all for your help, A referenced project had a different version in the bin folder (even though I cleaned the solution and set also the that project to reference the dll in the dependencies folder, it still copied the one from the bin folder). After deleting that one and rebuilding, redeployed dlls and it ran.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜