Web api in episerver doesn't work in iis



I have a web api in my EPiServer application which previously worked fine. But suddenly I can't get it to run in IIS. Localhost works fine. It seems the web api is found, but the routing is wrong. I get this error message in postman when I run (...)/api/epi/helptexts:

"Message": "No HTTP resource was found that matches the request URI '(...)/api/epi/helptexts'.",
"MessageDetail": "No type was found that matches the controller named 'helptexts'."

This is the controller:

public class ContentController : ApiController
public HttpResponseMessage GetHelptextsNorwegian()

This is the webApiConfig.cs:

  public class WebApiConfig : IInitializableModule

 public void Initialize(InitializationEngine context)
      GlobalConfiguration.Configure(config =>

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

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

        settings.Formatting = Formatting.Indented;


          name: "DefaultEpiApi",
          routeTemplate: "api/epi/{controller}/{id}",
          defaults: new { id = RouteParameter.Optional });

This configuration works fine in another site. Can anyone point me in the right direction?

Oct 09, 2018 9:26

I finally figured it out. I had to upgrade the .net framework from 4.5 to 4.6. I have no idea why, because everything was working fine before.

Oct 09, 2018 13:54
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.