views:

107

answers:

3

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_AddImplicitRequiredAttributeForValueTypes(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?

Thank you!

A: 

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.

Darin Dimitrov
This is the RTM build version number.
Debra
This is the file version, the assembly version is 2.0.0.0
Darin Dimitrov
A: 

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.

Mahesh Velaga
Thanks, I did copy it to my dependencies folder,referenced the dll from the dependency folder and set copy local to true
Debra
A: 

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.

Debra