PC Review


Reply
Thread Tools Rate Thread

XMLTextReader hangs machine in forms load functions

 
 
Walt Smith - Vectiva.com
Guest
Posts: n/a
 
      10th Dec 2003
Microsoft .NET Team:

I would like to report what I think is a bug in the
XMLTextReader class. The bug can be reproduced in the
following manner:

1) Create a C# Windows Application Project and add a form
to it. Add System.XML to the namespaces of the project.
2) Add a ListBox control to the form, name it lbUsers
3) Add the following code to the OnLoad event of the form:

protected override void OnLoad(EventArgs e)
{
XmlTextReader xmlConfigFile;

string filename = Application.StartupPath
+ "\\test.vtx";
xmlConfigFile = new XmlTextReader(filename);

while(xmlConfigFile.Read())
{
if(xmlConfigFile.NodeType == XmlNodeType.Element)
{
if(xmlConfigFile.Name == "User")
{
if(xmlConfigFile.HasAttributes)
{
while(xmlConfigFile.MoveToNextAttribute())
{
if(xmlConfigFile.Name == "Name")
lbUsers.Items.Add
(xmlConfigFile.Value);
}
}
}
}
}
lbUsers.Refresh();
base.OnLoad (e);
}

4) Place the following XML File in the application
directory for the project (the /debug directory). Name
the file test.vtx

<?xml version="1.0" encoding="UTF-8" ?>
<ConfigData>
<UserInfo>
<Users>
<User Name="AUDREY">
</User>
<User Name="WESLEY">
</User>
<User Name="DADDY">
</User>
</Users>
</UserInfo>
</ConfigData>


5) DO NOT PLACE any breakpoints in the code.
6) Use the F5 key (Debug/Run) to execute the code.

Result: The machine will hang. The only choice is the
power switch. CTRL-ALT-DEL is ineffective.

Other information:
a) If you execute this code from a Button.Click event on
the form, IT WORKS JUST FINE.
b) If you comment out all of the code inside the while
loop in the function, the machine will still hang.
c) If you move the base class OnLoad above the while
loop, the code will still hang.
d) If you put this code in the OnActivate function of the
form, the code will still hang.

Please verify this bug, and suggest a workaround if
possible. Thank you for your help.

Walt Smith
Vectiva.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use a Virtual Machine to load second OS on dual boot machine? Brian Windows XP Basics 6 2nd Mar 2011 10:12 PM
Can I use a Virtual Machine to load second OS on dual boot machine? Brian Windows XP General 2 26th Jun 2006 06:39 PM
XmlTextReader constructor hangs (only on 1.1 SP1)... Tom Shelton Microsoft VB .NET 4 25th Jan 2005 10:27 PM
Microsoft Forms - Could not load an object because not available on this machine Mark Microsoft Excel Misc 1 1st Sep 2004 02:28 PM
Microsoft Forms: Cannot load as some objects are missing from this machine Graham Microsoft Excel Setup 0 8th Jan 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:53 AM.