1

I'm pretty new in ASP.NET MVC (about 3 months) and i've the followin issue:

I have a Entity Class called 'Usuario' in a ClassLibrary referenced as 'Core' and, when i create a strongly-typed view and add a html.textboxfor<> like:

<%= Html.TextBoxFor(u => u.Login) %>

it raises the following error:

Error   3   The call is ambiguous between the following methods or properties:
'Microsoft.Web.Mvc.ExpressionInputExtensions.TextBoxFor<Core.Usuario,string>(System.Web.Mvc
.HtmlHelper<Core.Usuario>, 
System.Linq.Expressions.Expression<System.Func<Core.Usuario,string>>)' and 
'System.Web.Mvc.Html.InputExtensions.TextBoxFor<Core.Usuario,string>(System.Web.Mvc.HtmlHel
per<Core.Usuario>,     System.Linq.Expressions.Expression<System.Func<Core.Usuario,string>>)'   
d:\Documents\Visual Studio 
2008\Projects\GuiPereiraMVC2\GuiPereiraMVC2\Views\Gestao\Index.aspx 20  25  

GuiPereiraMVC2

anyone knows why?

3 Answers 3

2

Sure, simple :)

You probably recently updated your version of MVC 2. In your web project, you have the reference to Microsoft.Web.Mvc (the MVC Futures assembly).

Some of the methods from it have been moved to the core assembly, making the reference to Microsoft.Web.Mvc unnecessary. You can easily remove it now :)

Btw.. Some of the methods haven't been moved, like the Html.Css / Html.Script helpers. But if you didn't use them - you'll be fine :) Also, you might try to update your Microsoft.Web.Mvc library if you still need it. I guess they would have removed these methods from the Futures library since the official release!

Sign up to request clarification or add additional context in comments.

2 Comments

The Microsoft.Web.Mvc gives the 'Html.Submit', which i'm using.... the core do not have some of this kind of helpers that i need... is it out-of-date?
It might be... try go to the Mvc Futures website, and download the latest build from there )
1

You have several (at least two) versions of MVC assemblies mentioned in your web.config. Take a look there.

2 Comments

The Microsoft.Web.Mvc gives the 'Html.Submit', which i'm using.... the System.web.mvc version is the follow: <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> is it deprecated? what do i have to do?
You have to get rid of Microsoft.Web.Mvc. Leave only the "System" one.
1

The discover the problem is to download MVCDiagnostics either from codeplex or better yet use Nuget.

http://haacked.com/archive/2010/12/05/asp-net-mvc-diagnostics-using-nuget.aspx

Once you run it in your browser like this: http://localhost:61839/MvcDiagnostics.aspx

You will see in Red color the problem (which for me looked like this) : ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)

Mismatched or outdated versions of ASP.NET MVC and ASP.NET MVC Futures are loaded.

Loaded version of ASP.NET MVC is: Unknown version (3.0.20105.0) Loaded version of ASP.NET MVC Futures is: ASP.NET MVC 2 RTM Futures (2.0.50217.0) A download for this version of ASP.NET MVC Futures is not available. Pre-release versions of the MVC Futures assembly are no longer available once that version of ASP.NET MVC has gone RTM.

Assembly version: ASP.NET MVC 2 RTM Futures (2.0.50217.0) Full name: Microsoft.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null Code base: file:///C:/dev/20110630_OVR_MVC3/OVR_MVC3/OVR/bin/Microsoft.Web.Mvc.DLL Deployment: bin-deployed

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.