found the error, because I changed the namespace and assembly name, then on the bin folder the old dll was still there, so it looks like the mvc engine searches for controllers in the entire bin folder. 也就是说报此错误的可能原因是bin目录下有就的dll产生了干扰. http://stackov…
当使用ASP.NET MVC的Area功能时,出现了这样的错误: Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matc…
偶然的一个机会,修改了已经开发完毕的一个项目的命名.突然运行发现: { "Message": "An error has occurred.", "ExceptionMessage": "Multiple types were found that match the controller named 'Auth'. This can happen if the route that services this request ('ap…
异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 错误信息 和主页的默认控制器冲突了,修改下Areas里面的默认控制器就可以了…
Unions are used when we want a GraphQL field or list to handle multiple types of data. With a Union Type, we can define a field that could resolve completely different types of data. In this lesson, we will write a query that obtains a list of differ…
问题背景:在使用普通的SelfHost时,调用其它工程的dll(其实就是把WebApi写到一个单独的工程方便管理),通过加载其他工程的dll然后再访问webapi是没有问题的. 但是在使用Owin SelfHost时,调用其它工程的dll,访问WebApi时会抛出No type was found that matches the controller named 'Contacts',这是因为调用其它工程的dll时,我们需要告诉Owin SelfHost我们要用这个dll,怎么告诉他呢,使用普…
https://stackoverflow.com/questions/14534167/multiple-actions-were-found-that-match-the-request-in-web-api Answer1 Your route map is probably something like this: routes.MapHttpRoute( name: "API Default", routeTemplate: "api/{controller}/{i…
在WebAPI工程入口不对外公开的接口不能使用public. [HttpPost] public string PostRequest([FromBody] Model model) { /// } //Validate方法是不对外公布的,得弄成私有的. private bool Validate(Model model) { return true; }…
这是在使用QT的时候看到的.这种情况往往是结构体或者是class最后少加了一个分好,加上即可,这个bug找了我好久,mark一下.…
MVC最核心的也就是Controller了,控制器(controller)在功能中起到了核心功能. 1,)在MVC类库中,根据URL,通过MVCHandler进入MVC处理系统中, 2,)解析初始化对应的Route信息, 3,)在MVCHandler的Begin_RequestHandler函数中,根据URL获取到对应的Controller,和Action, 4,)在执行Controller.Execute之前还需要进行一个验证处理, 5,)之后执行Exceute, 6,)在Execute处理过…