How to configure Web Api 2 to look for Controllers in a separate project? (just like I used to do in Web Api)

前端 未结 8 1811
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 17:40

I used to place my controllers into a separate Class Library project in Mvc Web Api. I used to add the following line in my web api project\'s global.asax to look for contro

8条回答
  •  感动是毒
    2020-12-04 18:29

    When using AttributeRouting it is easily forgettable to decorate your methods with the Route Attribute, especially when you are using the RoutePrefix Attribute on your controller class. It seems like your controller assembly wasn't picked up by the web api pipeline then.

提交回复
热议问题