Visual Basic.NET - XMLWriter Infinite loop

 
Vista:

XMLWriter Infinite loop

Publicado por eduardoquiroz (1 intervención) el 02/02/2010 01:39:35
Hola a todos.
Estoy teniendo un problema con un "infinite loop" que no logro comprender de donde aparece, al momento de declarar una variable del tipo XMLWriter. Como datos puedo entregar que el XML que ahi escribo, realiza una actualización cada 0,5 o 1 sg. aprox. en el mismo XML. Está escrito en VB .Net para un framework 2.0.
Esta es parte del código:

Try
Dim fs As FileStream = File.Open(fileName, FileMode.Create, FileAccess.Write, FileShare.Read)
Dim objXMLTW As New XmlTextWriter(fs, Encoding.ASCII) <---- ERROR AQUI
Dim i As Integer
'ESCRIBE XML
objXMLTW.WriteStartElement(etiqueta)
objXMLTW.WriteWhitespace(vbCrLf)
For i = 0 To (nombres.Length - 2)
objXMLTW.WriteWhitespace(ControlChars.Tab)
objXMLTW.WriteElementString(nombres(i), "", valores(i))
objXMLTW.WriteWhitespace(vbCrLf)
Next i
objXMLTW.WriteEndElement()
objXMLTW.WriteWhitespace(vbCrLf)
objXMLTW.Flush() 'Write to file
objXMLTW.Close()
fs.Close()
Catch Ex As Exception
Console.Write("replaceXML: " & Ex.Message & vbCrLf)
End Try

y el error es el siguiente:
{System.StackOverflowException}
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder