"No overload for method 'GetValue' takes 2 arguments" error when building Csla 4.0

"No overload for method 'GetValue' takes 2 arguments" error when building Csla 4.0

Old forum URL: forums.lhotka.net/forums/t/8698.aspx


raz0rf1sh posted on Saturday, March 20, 2010

I'm getting the following error when trying to build the latest CSLA 4.0.0 framework ...

No overload for method 'GetValue' takes 2 arguments

It's happening in the CslaModelBinder.cs class in the following line of code... 

          bindingContext.ModelState.SetModelValue(item.Property, bindingContext.ValueProvider.GetValue(controllerContext, item.Property));

If I remove the controllerContext parameter ... as it doesn't look like GetValue supports it ... I am able to build.
Am I doing something wrong here?

RockfordLhotka replied on Saturday, March 20, 2010

This is in the Csla.Web.Mvc project, and occurs because you don't have the same version of ASP.NET MVC 2 we're currently using (or that we were using when that particular code was created).

The problem is that ASP.NET MVC 2 is changing rapidly, and it is not in sync with VS10 or .NET 4 - nor will it be in sync, it is not being released as part of .NET 4.

This is why we split the MVC support into its own assembly/project - so you can use the rest of CSLA 4 even if you don't have or want MVC.

If you do want to use MVC, you'll have to fix the code. Or maybe grab the most current code from my svn repository, because that might match the MVC version you are using.

Copyright (c) Marimer LLC