Receive class inherited from WCF Service when KnownType Class is in another project?

48 Views Asked by At

I need receive a class inherited through WCF Service.

<DataContract()>
<KnownType(GetType(A))>
Public class Base
...
End Class

<DataContract()>
Public Class A
Inherits Base
...
End Class

The problem is that A class is in my business logic project and it references Base class that is in another project (util project). Then i can't do:

<KnownType(GetType(A))>

In Base class because i would need add a reference to business logic project from util project to know class A, but its throws cyclic reference error.

And well, WCF project references business logic project to send data.

1

There are 1 best solutions below

0
On

Well, finally i created a class called 'pack' in business logic project and extends Base that is in util project, then 'pack class' can know class that are in business logic project and 'A class' extends 'pack class', and 'pack class' is the one that is send through WCF Services.