The code above does not work as expected, as my Web API controller method is returning an instance of B, and the formatter is looking for a serializer for B and not Base where the well-know types were defined.

A similar scenario is presented when a custom resolver must be used with the data contract serializer.

This is by design. The SetSerializer method works on the declared type of the action and needs to match exactly. Inheritance doesn't apply. Is there any reason you can't just change the declared type on your action to Base?

We're looking into adding more extensibility to the XmlMediaTypeFormatter so that you can create the right serializer for your type at runtime for a future release. That would allow you to customize the serializer in a more fine-grained way than by
using SetSerializer.