No type was found that matches the controller named 'User'

后端 未结 14 2488
孤城傲影
孤城傲影 2020-12-23 19:49

I\'m trying to navigate to a page which its URL is in the following format: localhost:xxxxx/User/{id}/VerifyEmail?secretKey=xxxxxxxxxxxxxxx

I\'ve added a new route i

14条回答
  •  感动是毒
    2020-12-23 20:13

    In my case, the controller was defined as:

        public class DocumentAPI : ApiController
        {
        }
    

    Changing it to the following worked!

        public class DocumentAPIController : ApiController
        {
        }
    

    The class name has to end with Controller!

    Edit: As @Corey Alix has suggested, please make sure that the controller has a public access modifier; non-public controllers are ignored by the route handler!

提交回复
热议问题