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

I have just confirmed that this works fine. Things to check:

References: Does your main Web API project reference the external class library?

Routing: Have you set up any routes that might interfere with the external controllers?

Protection Level: Are the controllers in the external library public?

Inheritance: Do the controllers in the external library inherit from ApiController?

Versioning: Are both your Web API project and class library using the same version of the Web API libraries?

If it helps, I can package up my test solution and make it available to you.
Also, as a point to note, you don’t need to tell Web API to find the controllers with the line you added to Global.asax, the system finds the controllers automatically provided you have them referenced.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)