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

后端 未结 14 2408
孤城傲影
孤城傲影 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:15

    I have also faced the same problem. I searched a lot and found that the class level permission is needed. by default, the class permission level is internal so I thought that it won't affect the program execution. But it got affected actually, you should give your class permission as public so that, you won't face any problem.

    And one more. if it is webapi project, your webapirouteconfig file will overwrite the routeconfig.cs file settings. So update the webapi routeconfig file as well to work properly.

    0 讨论(0)
  • 2020-12-23 20:15

    Faced the same problem. Checked all the answers here but my problem was in namespacing. Routing attributes exists in System.Web.Mvc and in System.Web.Http. My usings included Mvc namespace and it was the reason. For webapi u need to use System.Net.Http.

    0 讨论(0)
提交回复
热议问题