datacontractserializer and knowntype error

May 15, 2009 at 7:17 AM
Edited May 15, 2009 at 7: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 7:19 AM
Edited May 15, 2009 at 7:20 AM

see here for the message: picasa image

http://picasaweb.google.it/lh/photo/lugwfqIIQZh6sYBpe_N6eA?feat=directlink

(no way to add attachments to forun posts?)

Coordinator
May 15, 2009 at 7: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.

Regards

Rob

May 15, 2009 at 8: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 ;)

Coordinator
May 19, 2009 at 6: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 6:56 AM

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

Apr 27, 2012 at 11:31 AM

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?

Coordinator
Apr 27, 2012 at 3: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 9:17 AM

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

Best regards

Bogdan