I would like to force svcutil to generate all data contracts in an assembly that is used by WCF, regardless of whether or not a type is referenced by a given operation contract.
[DataContract]
public class Foo { }
[DataContract]
public class Bar : Foo { }
[ServiceContract]
public interface IService
{
[OperationContract]
void Get(Foo foo);
}
Given this setup I cannot get svcutil to generate a version of Bar as there are no operation contracts that currently reference it. Is there a way to force svcutil to generate the data contract for Bar?
Add a KnownType attribute to the Foo class
[KnownType(typeof(Bar))]
[DataContract]
public class Foo { }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With