Help with error CS0030: Cannot convert type

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
 
M

Marc Gravell

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
 
N

nomad

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
 

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