471,330 Members | 1,273 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Help with error CS0030: Cannot convert type

Hi,

When trying to serialize a class I keep getting the message below.
optionalExtensionTypeOptionalExtension is not mandatory so not sure
why this is appearing.

If anyone has seen this type of error before and found a way around
it, it would be greatly appreciated.

error CS0030: Cannot convert type
'Confused.HomeInsurance.BOB.AIG.CDLService.optiona lExtensionTypeOptionalExtension[]'
to
'Confused.HomeInsurance.BOB.AIG.CDLService.optiona lExtensionTypeOptionalExtension'
Thanks in advance
Aug 15 '08 #1
2 4415
It sounds like there is a mismatch between an array and a single
instance... while it may be optional, if some data is found it expects
to understand it.

Which serializer are you using, btw?

We're not going to be able to offer much help without a bit more info
on how this is all declared...

Marc
Aug 15 '08 #2
On Aug 15, 3:24*pm, Marc Gravell <marc.grav...@gmail.comwrote:
It sounds like there is a mismatch between an array and a single
instance... while it may be optional, if some data is found it expects
to understand it.

Which serializer are you using, btw?

We're not going to be able to offer much help without a bit more info
on how this is all declared...

Marc
Hi Marc,

I am using the frameworks XmlSerializer. Although this is optional I
have tried to initialise an instance of the array i.e.
optionalExtension = new optionalExtensionTypeOptionalExtension[] (new
optionalExtensionTypeOptionalExtension()); to see if that works but
still no joy. I have only been doing C# for about a month so
apologise if I'm not more specific.

Appreciate your help
Aug 16 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jill Graham | last post: by
3 posts views Thread by Drewdog | last post: by
1 post views Thread by Jill Graham | last post: by
1 post views Thread by keithb | last post: by
3 posts views Thread by WayDownUnder | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.