1

I've used N2 CMS for a while now, I've just updated to use MVC 3 RC and I'm now recieving this error on every page:

The current request for action 'index' on controller type 'HomeController' is ambiguous between the following action methods: System.Web.Mvc.ActionResult Index() on type Project.Web.Controllers.N2Controller1[[Project.Web.Models.HomePage, Project.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] System.Web.Mvc.ActionResult Index() on type N2.Web.Mvc.ContentController1[[Project.Web.Models.HomePage, Project.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

Just to explain I have a HomeController, that inherits from N2Controller< HomePage >, N2Controller< T > inherits from N2.Web.Mvc.ContentController< T >.

Each controller, Home, Account etc don't have Index methods because the ContentController already has one.

This all worked absolutely fine with MVC 2, but with MVC 3 RC it's throwing this error.

Any ideas anyone? I can't find anything online...

Cheers, Ash.

Ash
  • 754
  • 1
  • 10
  • 18

1 Answers1

1

This sounds like N2Controller has an Index method which should be set to override the Index method in ContentController.

The way an action method is resolved on a controller must have changed between MVC2 and 3 to take into account the inheritance hierarchy, causing this problem.

spmason
  • 4,048
  • 2
  • 24
  • 19
  • I was overriding the Index method, but I removed this and it worked....I didn't mention I was running this in the Azure dev fabric, Razor took an age to get working on Azure too! – Ash Jan 14 '11 at 12:11