This project has moved and is read-only. For the latest updates, please go here.

datacontractserializer and knowntype error

May 15, 2009 at 8:17 AM
Edited May 15, 2009 at 8:18 AM

I'm trying to use the last build from the downloadsection to make some tests of my WCF service.

I'm able to make all the wizard correctly, but when I try to generate the code i receive this error

"...add the type corresponding to DefaukltTicketType to the list of knowntypes..."

My datadomain has a general structure like this:

DefaultTicketType (DataContract) -> DefaultTicketTypeBase (DataContract) -> DefaultTicketTypeId (Serializable) -> BaseId (Serializable)

I've defined all my ServiceKnownType attributes in contract folder, but I'm using a separated assembly for my datadomain, assembly that I share for the client and for the server.

So this means that my serializer don't serialize the domain objects for the client, instead uses the objects in the assembly both for server and for client operations.

Any suggestions?


May 15, 2009 at 8:19 AM
Edited May 15, 2009 at 8:20 AM

see here for the message: picasa image

(no way to add attachments to forun posts?)

May 15, 2009 at 8:48 AM

I am not sure I fully understand which types are in which assemblies, but did you make sure that all the assemblies required for serialization and deserialization of the objects were included in the dialog where you are asked to supply the assemblies?

If so then would it be possible for you to send me a small repro of the problem? Ideally I would like a repro that uses the command line version of the tool, so you send me the trace, the command line config file, and the assemblies you need to reference for the repro.

Contact me via the People page and then we can exchange email with attachments.



May 15, 2009 at 9:00 AM

I'm adding the Contract assembly (interfaces for service definitions) and DataDomain assembly (Domain objects).

I try to create a sample to send to you soon, thanks for support ;)

May 19, 2009 at 7:49 AM

The problem is that the known types are being supplied using the ServiceKnownType attribute rather than the KnownType attribute. The tool does not currently cope with ServiceKnownType. If possible, change the code to use KnownType. In the meantime I will work on a fix for this problem.

May 19, 2009 at 7:56 AM

I try to do this as soon as possible. Thanks for support :)

Apr 27, 2012 at 12:31 PM

I'm facing the same problem with ServiceKnownType using the latest version of wcfloadtest.

Will this be fixed or this tool is no longer maintain?

Apr 27, 2012 at 4:42 PM

I am not finding a lot of time to do fixes at the moment. Does the suggested workaround not work for you?

May 7, 2012 at 10:17 AM

Unfortunately, I cannot change the code to use KnownType instead of ServiceKnownType. If you think of another workaround please share.

Best regards