title: Value of type cannot be converted to '1-dimensional array of .. VB
body: <p>EDIT2: Solution found, thanks to Fabio. </p>
  
  <p>The title has the error message I get when I try to fill my XML file. </p>
  
  <p>Here is some code</p>
  
  <pre><code>&lt;!-- language: lang-vb --&gt;
  
          &lt;System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
           System.SerializableAttribute(),  _
           System.Diagnostics.DebuggerStepThroughAttribute(),  _
           System.ComponentModel.DesignerCategoryAttribute("code"),  _
           System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:com.x.x"),  _
           System.Xml.Serialization.XmlRootAttribute("MT_AnalyseQueueResponse_EXT", [Namespace]:="urn:com.x.x", IsNullable:=false)&gt;  _
          Partial Public Class DT_AnalyseQueue_EXT
  
              Private resField As DT_AnalyseQueue_EXTRes
                  &lt;System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)&gt;  _
              Public Property Res() As DT_AnalyseQueue_EXTRes
                  Get
                      Return Me.resField
                  End Get
                  Set
                      Me.resField = value
                  End Set
              End Property
          End Class
  
          &lt;System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"),  _
           System.SerializableAttribute(),  _
           System.Diagnostics.DebuggerStepThroughAttribute(),  _
           System.ComponentModel.DesignerCategoryAttribute("code"),  _
           System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, [Namespace]:="urn:com.x.x")&gt;  _
          Partial Public Class DT_AnalyseQueue_EXTRes
            Private locationField() As DT_AnalyseQueue_EXTResLocation
            '''&lt;remarks/&gt;
            &lt;System.Xml.Serialization.XmlElementAttribute("Location", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)&gt; _
            Public Property Location() As DT_AnalyseQueue_EXTResLocation()
              Get
                Return Me.locationField
              End Get
              Set(value As DT_AnalyseQueue_EXTResLocation())
                Me.locationField = value
              End Set
            End Property
          End Class
  &lt;System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"), _
   System.SerializableAttribute(), _
   System.Diagnostics.DebuggerStepThroughAttribute(), _
   System.ComponentModel.DesignerCategoryAttribute("code"), _
   System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:com.x.x")&gt; _
  Partial Public Class DT_AnalyseQueue_EXTRes
  
    Private locationField() As DT_AnalyseQueue_EXTResLocation
  
    Private resultsField() As DT_AnalyseQueue_EXTResResultsCylinder
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlElementAttribute("Location", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)&gt; _
    Public Property Location() As DT_AnalyseQueue_EXTResLocation()
      Get
        Return Me.locationField
      End Get
      Set(value As DT_AnalyseQueue_EXTResLocation())
        Me.locationField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlArrayAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified), _
     System.Xml.Serialization.XmlArrayItemAttribute("Cylinder", GetType(DT_AnalyseQueue_EXTResResultsCylinder), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=False)&gt; _
    Public Property Results() As DT_AnalyseQueue_EXTResResultsCylinder()
      Get
        Return Me.resultsField
      End Get
      Set(value As DT_AnalyseQueue_EXTResResultsCylinder())
        Me.resultsField = value
      End Set
    End Property
  End Class
  &lt;System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"), _
   System.SerializableAttribute(), _
   System.Diagnostics.DebuggerStepThroughAttribute(), _
   System.ComponentModel.DesignerCategoryAttribute("code"), _
   System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:com.xx.xx")&gt; _
  Partial Public Class DT_AnalyseQueue_EXTResLocation
  
    Private noField As String
  
    Private testpointField As String
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property No() As String
      Get
        Return Me.noField
      End Get
      Set(value As String)
        Me.noField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property Testpoint() As String
      Get
        Return Me.testpointField
      End Get
      Set(value As String)
        Me.testpointField = value
      End Set
    End Property
  End Class
  &lt;System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1"), _
   System.SerializableAttribute(), _
   System.Diagnostics.DebuggerStepThroughAttribute(), _
   System.ComponentModel.DesignerCategoryAttribute("code"), _
   System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:com.xxx.xx")&gt; _
  Partial Public Class DT_AnalyseQueue_EXTResResultsCylinder
  
    Private detailField() As DT_AnalyseQueue_EXTResResultsCylinderDetail
  
    Private dateField As String
  
    Private batchNoField As String
  
    Private resultField As String
  
    Private infoField As String
  
    Private bIDField As String
  
    Private completeField As String
  
    Private releaseField As String
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlElementAttribute("Detail", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)&gt; _
    Public Property Detail() As DT_AnalyseQueue_EXTResResultsCylinderDetail()
      Get
        Return Me.detailField
      End Get
      Set(value As DT_AnalyseQueue_EXTResResultsCylinderDetail())
        Me.detailField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property [Date]() As String
      Get
        Return Me.dateField
      End Get
      Set(value As String)
        Me.dateField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property BatchNo() As String
      Get
        Return Me.batchNoField
      End Get
      Set(value As String)
        Me.batchNoField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property Result() As String
      Get
        Return Me.resultField
      End Get
      Set(value As String)
        Me.resultField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property Info() As String
      Get
        Return Me.infoField
      End Get
      Set(value As String)
        Me.infoField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property BID() As String
      Get
        Return Me.bIDField
      End Get
      Set(value As String)
        Me.bIDField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property Complete() As String
      Get
        Return Me.completeField
      End Get
      Set(value As String)
        Me.completeField = value
      End Set
    End Property
  
    '&lt;remarks/&gt;
    &lt;System.Xml.Serialization.XmlAttributeAttribute()&gt; _
    Public Property Release() As String
      Get
        Return Me.releaseField
      End Get
      Set(value As String)
        Me.releaseField = value
      End Set
    End Property
  End Class
  
      Public Sub() 
    Dim Mydet As New DT_AnalyseQueue_EXTResResultsCylinderDetail() With {.Component = "", .Limit = ""}
    Dim MyresCy As New DT_AnalyseQueue_EXTResResultsCylinder() With {.BatchNo = "", .Detail = {Mydet}}
    Dim Myloc As New DT_AnalyseQueue_EXTResLocation() With {.No = sLocNo, .Testpoint = sTestP}
    Dim Myres As New DT_AnalyseQueue_EXTRes() With {.Location = {Myloc}, .Results = {MyresCy}}
    Dim MyCylE As New DT_AnalyseQueue_EXT() With {.Res = Myres}
  
    Dim MyXMLSerializerLoc As New XmlSerializer(GetType(DT_AnalyseQueue_EXT))
        MyXMLSerializerLoc.Serialize(MyXMLWriter, MyCylE)
      End Sub
  </code></pre>
  
  <p>The with * marked code in the sub tells where the error message is shown.
  It seems to me that the defintion might be wrong, but actually I think DT_AnalyseQueue_EXTResLocation is defined as an array. 
  +
  EDIT: </p>
  
  <p>So I added information and the code in the way Fabio suggested. 
  Now the error message is 
  Value of type 'CustomProjectGlobal.DT_AnalyseQueue_EXTResResultsCylinder' cannot be converted to '1-dimensional array of 1-dimensional array of CustomProjectGlobal.DT_AnalyseQueue_EXTResResultsCylinder'</p>
  
  <p>And if I do not implement that part, the serializer still produces and error and no XML file.</p>