Help with error CS0030: Cannot convert type

  • Thread starter Thread starter nomad
  • Start date Start date
N

nomad

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.optionalExtensionTypeOptionalExtension[]'
to
'Confused.HomeInsurance.BOB.AIG.CDLService.optionalExtensionTypeOptionalExtension'


Thanks in advance
 
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
 
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
 
Back
Top