Skip to content

Multiple actions matched #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bojanivancev opened this issue Mar 8, 2019 · 1 comment
Open

Multiple actions matched #28

bojanivancev opened this issue Mar 8, 2019 · 1 comment

Comments

@bojanivancev
Copy link

AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied:

MyProject.WebApp.Controllers.HomeController.Index (MyProject.WebApp)
MyProject.WebApp.Areas.Admin.Controllers.HomeController.Index (MyProject.WebApp)

I am issuing this problem when i am using areas... i.e. admin and identity area on this project...
so far, my routes look like this

routes.MapRoute(
name: "areaRoute",
template: "{area}/{controller=Home}/{action=Index}/{id?}");

routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}",
defaults: new { culture = LocalizationRouteDataHandler.DefaultCulture }
);

This was working before i put your code in place...

Do you have any suggestions?

thanks in advance

@saaratrix
Copy link
Owner

@bojanivancev Hi, I know I haven't tested it much with areas so that's probably the culprit that it just doesn't work with areas.

The error itself if I remember correctly is that there's 2 identical routes meaning the RouteDataConvention has created 2 identical routes, most likely because of the areas. Since you have 2 Home controllers for 2 different areas.

I'll try and find time to look into it and add Area support if I can.

But for now the best answer I can give you is that I don't think it's compatible with areas sadly. At least not if the controller shares the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants