WebApi2 Help Page stops generating documentation after extending ApiController

254 Views Asked by At

I have extended ApiController to include some common properties/methods, and this extended controller is held in a separate class library/assembly.

public class ExtendedApiController : ApiController
{
    // shared properties...
}

In my Api project, all controllers inherit from this extended controller.

public class HomeApiController : ExtendedApiController
{
    // actions...
}

Pretty simple...

However, extending the base class now prevents the Help Page generator from actually generating documentation from these controllers. If I switch the controllers back to inheriting directly from ApiController they are visible in the docs.

Is there a way to allow/change the assembly name the generator looks for? I have a sneaking suspicion that it is comparing a base class directly to "ApiController" and is therefore skipping all of mine.

1

There are 1 best solutions below

1
On

Well, as it turns out the fact that my base class was in a different assembly was part of the problem. The real issue was the fact that these projects referenced different versions of the WebApi2 libraries. Unfortunately, the conflicting package version was only listed as a warning, not an error, so I missed it. An update of all NuGet packages across all projects in the solution fixed the issue.