We have a Kentico 8.2 WebForms App in C#.NET using .NET Framework 4.0. I have recently implemented a WebAPI v1 Controller within the CMS project (Stored under CMSApp\ApiControllers\, as opposed to being inside a new library.
When I try to access an API method I get the following error No type was found that matches the controller named 'My'
No type was found that matches the controller named 'My'
I have just released the website to UAT but the Web API Controller isn't being registered. I had a similar issue in the DEV Environment, but re-releasing the build worked.
I am using Web API v4.0.30506 and have updated the various Web API libs to the same version. I have also added [assembly: RegisterApiController(typeof(CMSApp.ApiControllers.MyController))] to register the controller.
[assembly: RegisterApiController(typeof(CMSApp.ApiControllers.MyController))]
I have posted a similar question SO here:
StackOverflow Question
Many thanks.
Removing the "MS-ApiControllerTypeCache.xml" under "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" seemed to have fixed it.
Please, sign in to be able to submit a new answer.