Try our conversational search powered by Generative AI!

Content Delivery Installation Issue - All service except the content deliver api are being initialized


Hey everyone, hope someone can get me over the hump with an issue I am having getting all of the Apis installed on a project.

I have installed the following APIs into our solution:

  • ServiceApi
  • Content Delivery API
  • Content Deliver Search API
  • Content Management Api

I have a WebApiInit Module that calls GlobalConfiguration.Configuration.MapHttpAttributeRoutes()

    public class WebApiInitialization : IInitializableModule
        public void Initialize(InitializationEngine context)
        public void Uninitialize(InitializationEngine context) {}

The following settings have been added to disable the MapHttpAttributeRoutes

 <!-- Content Delivery API -->
  <add key="episerver:contentdelivery:maphttpattributeroutes" value="false" />
  <add key="episerver:contentdeliverysearch:maphttpattributeroutes" value="false" />
  <!-- Content Management API -->
  <add key="episerver:contentmanagementapi:maphttpattributeroutes" value="false" />
  <!-- Service API -->
  <add key="episerver:serviceapi:maphttpattributeroutes" value="false" />
  <add key="episerver:serviceapi:requiressl" value="false" />

I have also set optimizeCompilations="false" in the web.config.

When my site loads I have code that lists the available routes.  All of the routes are showing EXCEPT for the Content Delivery Routes.  I don't think that set of APIs are being initialized. 

To test this I removed the WebApiInitialization code above and  played around with the appsetttings

  • With the app settings above none of the APIs were loaded. 
  • When episerver:contentdelivery:maphttpattributeroutes was set to true none of the api routes were registered
  • When episerver:contentdeliverysearch:maphttpattributeroutes was set to true all of the routes EXCEPT the Content Delivery Api were registered
  • When episerver:contentdeliverysearch:maphttpattributeroutes and episerver:contentdelivery:maphttpattributeroutes were set to true all of the routes EXCEPT the Content Delivery Api were registered. I would expect this to throw an error of "A route named 'MS_attributerouteWebApi' is already in the route collection."
  • When any two non content delivery api maphttpattributeroutes settings were set to true I would recive the error of "A route named 'MS_attributerouteWebApi' is already in the route collection." (which would be the correct behavior)

Also, I have validated the the content delivery api assembly was deployed correctly to my bin folder :-)

Thanks in advance for any ideas or suggestions!!!

Jul 14, 2021 4:41

Ok, I figured out the issue.  When the project was setup not all of the ContentDelivery API Nuget packages were included (no idea why this was).  But installing the missing packges resolved this issue.

Jul 19, 2021 18:28
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.