XmlSerializer throws InvalidOperationException "Two mappings for..

G

Guest

We have a set of data transfer objects (DTOs) with a rich namespace and
inheritance/containment hierarchy which we expose from the server to clients
via web services. When transferring these classes between the server and a
rich client (non-compact framework) the XmlSerializer has no problem with
mapping the XML back to the DTOs.

However, the CF version of the XMLSerializer throws an
InvalidOperationException with the message "Two mappings for..." followed by
the name of the class that we assume it's choking on (e.g. "Two mappings for
SourceTree.DTO.InventoryItemCollection." ). We are not entirely sure the
collection class specified is the problem, we suspect it might be one of the
contained classes. There are no duplicate definitions of classes in our
library. Hence our confusion over possible causes of the error message.

If anybody has seen this error message before or knows what might be causing
it, we'd appreciate hearing from you.

We've searched MSDN, Google, and everywhere else we can think of, but can't
seem to find any reference to that error message. We are methodically
working through our library trying to isolate whatever is triggering that
error, but haven't been successful yet. Due to our client's NDA, posting
even portions of their source code to aid in finding the solution is not an
option. If we can isolate the cause, then we may be able to generate a
"generic" sample that demonstrates the problem which we can post.
 
A

adi c

Hi,
Did you find any answer to this issue?
I am having the same problem exactly with my object, works great in the full
framework but throw this "Two mappings for class..." error in the compact
framework.
Any help will be appreciate.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top