I'd like to know if I can add the same class as a knowntype to multiple abstract classes.

My problem at the moment is that I have two abstract classes in the same namespace:

Let's call this namespace "Thing"

I have two abstract classes in Thing, Fruit and Vegetable.

Both of these abstract classes are inherited by the two different classes in the same namespace, but have the same name. "Tomato"

So I have two declarations:

```
namespace Thing

[KnownType(typeof(Tomato))]
public abstract class Fruit {}

public sealed class Tomato: Fruit{}

```

as well as

```
namespace Thing

[KnownType(typeof(Tomato))]
public abstract class Vegetable {}

public sealed class Tomato: Vegetable{}

```

Type 'Thing.Tomato' cannot be added to list of known types since another type 'Thing.Tomato' with the same data contract name "{datacontractname: Tomato}" is already present.

I've refactored the two declarations of Tomato into it's own file and now one single declaration. Now everything will serialize, but when I look at the custom attributes for both abstract classes only one of them will get the knowntype attribute. That class will also be the only one that knows that it has a subclass of Tomato.

Edit: I was a bit too hasty with my refactor as I need Tomato to have multiple inheritance. At the moment I've changed namespace Thing to Thing.Fruit and Thing.Vegetable, keeping the multiple declarations. The duplication of code makes me dubious that this is a good solution though.