1

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.

2
  • 1
    I think there is something else going on, maybe something in the extended controller that the documentation generator doesn't get, because I use an extended controller like that in my web api without a problem with the generated documentation. Commented Jan 24, 2014 at 17:44
  • @Stephen your assumption was correct. answer below... Commented Jan 24, 2014 at 19:56

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Compile with 'warnings as errors', so you don't overlook them next time. There's a reason you are warned ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.