asp.net-mvcasp.net-mvc-2mvccontribasp.net-mvc-futures

ASP.NET MVC Futures 2 and MVCContrib 2 in the same web app / project


I have referenced both Microsoft.Web.Mvc.dll (MVC Futures 2) and MVCContrib.dll (from MVC Contrib 2), both current releases from Codeplex and I have a problem with strongly-typed RedirecToAction<>() function of Controller.

It worked fine until I referenced Futures 2..

This is the compile time error. Apparently this function is implemented in both assemblies. How can I resolve that?

Error 1 The call is ambiguous between the following methods or properties: 'Microsoft.Web.Mvc.ControllerExtensions.RedirectToAction(System.Web.Mvc.Controller, System.Linq.Expressions.Expression>)' and 'MvcContrib.ControllerExtensions.RedirectToAction(System.Web.Mvc.Controller, System.Linq.Expressions.Expression>)'


Solution

  • Use the fully qualified name you want to use, e.g. Microsoft.Web.Mvc.ControllerExtensions.RedirectToAction() so that the compiler knows which one you want to call.