By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,652 Members | 1,694 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,652 IT Pros & Developers. It's quick & easy.

Cannot create XmlSerializer from XSD generated class object

P: n/a
Hi all, I have ceated a CSharp class from an xml schema (xsd) by using the
command line tool XSD. When I attempt to create an XmlSerializer object from
the class object. I get the following two errors.

Cannot convert type
'mamc.regional.informatics.hermes.PaginationPageQu estionTriggerRule[]' to
'mamc.regional.informatics.hermes.PaginationPageQu estionTriggerRule'

Cannot implicitly convert type
'mamc.regional.informatics.hermes.PaginationPageQu estionTriggerRule' to
'mamc.regional.informatics.hermes.PaginationPageQu estionTriggerRule[]'

I am not quite sure why the XSD tool even generated a non collection, i.e.
single instance definition of the trigger rule. In the definition the
question can have 0 to unbounded instances of trigger and trigger can have 1
to unbounded instances of rule.

Any help with this is greatly appreciated.

--
Thank you,
John
May 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 16 May 2007 12:37:01 -0700, John A
<i-*********@newsgroups.nospamwrote:
>Hi all, I have ceated a CSharp class from an xml schema (xsd) by using the
command line tool XSD. When I attempt to create an XmlSerializer object from
the class object. I get the following two errors.

Cannot convert type
'mamc.regional.informatics.hermes.PaginationPageQ uestionTriggerRule[]' to
'mamc.regional.informatics.hermes.PaginationPageQ uestionTriggerRule'

Cannot implicitly convert type
'mamc.regional.informatics.hermes.PaginationPageQ uestionTriggerRule' to
'mamc.regional.informatics.hermes.PaginationPageQ uestionTriggerRule[]'

I am not quite sure why the XSD tool even generated a non collection, i.e.
single instance definition of the trigger rule. In the definition the
question can have 0 to unbounded instances of trigger and trigger can have 1
to unbounded instances of rule.

Any help with this is greatly appreciated.
I had the exact same error today. Have a look in the generated code
for PaginationPageQuestionTriggerRule, and look at the attribute above
it -it should be of type PaginationPageQuestionTriggerRule[], not
PaginationPageQuestionTriggerRule as it will probably be generated. I
think this is a bug in XSD.EXE.

--
Ludwig
http://www.coders-lab.be
May 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.