Привет, я получаю эту ошибку при сериализации в XML
Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'XYZ.ProducerChannel[][]' to 'XYZ.ProducerChannel[]'
error CS0029: Cannot implicitly convert type 'XYZ.ProducerChannel[]' to 'XYZ.ProducerChannel[][]'
Может кто-нибудь помочь мне с тем, что происходит?В зависимости от класса:
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("CarrierAppointment", typeof(ProducerChannel[]), IsNullable=false)]
[System.Xml.Serialization.XmlArrayItemAttribute("DistributionChannelInfo", typeof(ProducerChannel), IsNullable=false, NestingLevel=1)]
public ProducerChannel[][][] Producer
{
get
{
return this.producerField;
}
set
{
this.producerField = value;
}
}
Использование:
var producer = new InitialPurchaseOrder.ProducerChannel{DistributionChannelName = division};
bdParty.Producer = new InitialPurchaseOrder.ProducerChannel[][][]// {{},{},{producer}};
{new InitialPurchaseOrder.ProducerChannel[][]
{new InitialPurchaseOrder.ProducerChannel[]{producer}}};
Строка ошибки:
var serializer = new System.Xml.Serialization.XmlSerializer(txLife.GetType());
Связанные XSD:
<xs:element name="Policy" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Annuity" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="QualPlanType" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="tc" form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Пожалуйста, дайте мнезнаете, как это исправить.
Спасибо,