Try our conversational search powered by Generative AI!

Adding Web API controller results in error "o type was found that matches the controller named 'AssetIntegration'"

Vote:
 

I'm facing an issue where we need to add a Web API controller to our EPiServer project, but when calling it only error is received: No type was found that matches the controller named 'assetintegration'. I have also tried to install Commerce Rest API (https://github.com/BVNetwork/CommerceRestApi) but it’s the same with that. However we have no issues running the EPiServer Service API.

I have defined the API route in Global.asax:

GlobalConfiguration.Configuration.Routes.MapHttpRoute(

                name: "CustomApiRoute",

                routeTemplate: "api/{controller}/{action}/{id}",

                defaults: new { id = RouteParameter.Optional }

            );

Instead of the Global.asax I also tried to add InitializationModule for setting up te routing but this didn't help as well. 

One strange thing I noticed, though, was that the API is reachable only when started in debug from Visual Studio.

#122969
Jun 19, 2015 14:46
Vote:
 

Forgot to add that the Commerce version we use is 8.13.1. Also we are using EPiServer Service API.

#122970
Jun 19, 2015 15:00
Vote:
 

When logging the route data, the values seem to be fine:

{"controller":"AssetIntegration","action":"get","id":{}}

Even though, getting some interesting rows in the EPiServer log file:

EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/CMS/8.3.0.0'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/Shell/8.3.0.0'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/Commerce/8.13.1.711'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/EPiServer.Packaging.UI/3.2.2.0'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/EPiServer.Commerce.Shell/8.13.1.711'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/EPiServer/EPiServer.Commerce.Shell.ManagerIntegration/8.13.1.711'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/episerver'
EPiServer.Shell.Web.Routing.ModuleRouteCollection: Not routing '~/api/AssetIntegration/get' since it doesn't start with '~/modules'

#123109
Edited, Jun 25, 2015 8:34
Vote:
 

Can you dump RoutesTable content and see where in that list your route is registered?

#123177
Jun 25, 2015 23:48
Vote:
 

Resolved the issue by updating every single reference there was in the project. Updating only Web API and EPiServer didn't fix it. Strange.....

#123197
Jun 26, 2015 13:08
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.