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

前端 未结 8 1797
隐瞒了意图╮
隐瞒了意图╮ 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:05

    You need to tell webapi/mvc to load your referrenced assembly. You do that with the compilation/assemblies section in your web.config.

    
      
        
      
    
    

    Simple as that. You can do it with code the way @user1821052 suggested, but this web.config version will have the same effect.

提交回复
热议问题