November Happy Hour will be moved to Thursday December 5th.

API Feed of articles works in local but not in DXC

Vote:
 

We are currently developing an API feed from one of our sites.  The feed is to provide details of the latest articles and allow this to be displayed in our mobile app.  When we build the solution on our local development machines we can access the API to read the data. When we publish our site to the integration DXC environment the API is not accessible, we just get a 404 page not found.  The rest of the site works as intended.

We have mapped the API route in an initialisation module, using the below example code:

GlobalConfiguration.Configure(config =>
            {
                config.MapHttpAttributeRoutes();

                var formatters = GlobalConfiguration.Configuration.Formatters;
                var jsonFormatter = formatters.JsonFormatter;
                var settings = jsonFormatter.SerializerSettings;

                var enumConverter = new Newtonsoft.Json.Converters.StringEnumConverter();
                jsonFormatter.SerializerSettings.Converters.Add(enumConverter);

                config.Formatters.Remove(config.Formatters.XmlFormatter);

                config.Routes.MapHttpRoute(
                    name: "BespokeFeedsApi",
                    routeTemplate: "api/{controller}/{action}/{value}",
                    defaults: new { value = RouteParameter.Optional });
            });

Any ideas why this configuration won't work when deployed to the DXC environment?

We are running on EPiServer.CMS v11.9.2 and EPiServer.CMS.UI v11.5.2.

#195334
Edited, Jul 20, 2018 12:06
Vote:
 

Identified the issue here was with the version of the .NET framework being targetted.  The solution was targetting the 4.6.1 framework but the environment was on a different version.  I rebuilt the solution targetting 4.7.0 and once published to the DXC the API endpoints worked.

#195417
Jul 24, 2018 15:41
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.