views:

355

answers:

1

Hello, I just recently migrated my ASP.Net MVC project from MVC 2.0 Preview 2 to MVC 2.0 Beta, and my calls to Html.RenderAction broke because a new RenderAction method was introduced in MVC 2.0 Beta.

In the following line:

<% Html.RenderAction("DisplayIMHandles", "UserProfile", new { userProfileId = Model.Id }); %>

I get the following error:

Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties:

'System.Web.Mvc.Html.ChildActionExtensions.RenderAction(System.Web.Mvc.HtmlHelper, string, string, object)' and 'Microsoft.Web.Mvc.ViewExtensions.RenderAction(System.Web.Mvc.HtmlHelper, string, string, object)'

I can solve the problem by replacing the line with the either of these 2 alternatives:

<% Microsoft.Web.Mvc.ViewExtensions.RenderAction
(this.Html, "DisplayIMHandles", "UserProfile", new { userProfileId = Model.Id }); %>

or

<% System.Web.Mvc.Html.ChildActionExtensions.RenderAction
(this.Html, "DisplayIMHandles", "UserProfile", new { userProfileId = Model.Id }); %>

Which of the two should I use, what are the differences? Also, is there any way to fix the problem without writting the whole namespace, like I used to have it?

Thank you in advance.

+4  A: 

It'll be because you're still referencing the old futures library and now that it has been carried over to the main MVC library (the Beta), you've got it in two places.

If you want to fix it, download the new futures library that is for use with the beta release and reference that in your project rather than the old one.

You can find it at the ASP.NET CodePlex site.

HTHs,
Charles

Charlino