Several types were found that match the controller named "Home",

I just started using dotnetopenauth to register my user. This is great and works great.

The problem is that I get an error when I try to go to / Home /, which says:

Several types were found that match the controller named "Home." This can happen if the route serving this request ('{controller} / {action} / {id}') does not define a namespace to find the controller that matches the request. If so, register this route by overloading the MapRoute method, which accepts the namespaces parameter.

The following matching controllers were found in the query "Home": OpenIdRelyingPartyMvc.Controllers.HomeController
YourApp.Controllers.HomeController

The problem is that I have no idea where OpenIdRelyingPartyMvc.Controllers.Homecontroller comes from. I can’t find ANY instance of "OpenIdRelyingPartyMvc" anywhere in my application, save 2 places, both of which occur in UserController:

OpenIdRelyingParty openid = new OpenIdRelyingParty();

I tried to remove the DLL and rebuild the application - no change. I can't figure out where this other controller will be.

Any ideas?

+3
source share
3 answers

, DLL DotNetOpenAuth sample. . OpenIdRelyingPartyMvc MVC.

, - DotNetOpenAuth, .

+3

.

, , ( "Clean Solution" - VS ).

+5

use this in route.config file

routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    new[] { "ProjectName.Controllers" }
);

Note. The name of the project that you specified when creating the project

0
source

Source: https://habr.com/ru/post/1771217/


All Articles