09 August 2005

Bugs found in .NET Compact Framework 1.1

I found some bugs in the Microsoft .NET Compact Framework when developing an application for my PocketPC. Hopefully they get fixed in .NET 2.0 as MS promised me several month ago. Here are short descriptions of the bugs:

1. System.Windows.Forms.TreeView after calling .Clear the property .SelectedNode is still set. Treeview.SelectedNode is still pointing to a treenode (the last node in the treeview before clearing it).
Workaround: Set the Selectednode to nothing before calling Clear

2. System.Windows.Forms.TreeView.SelectedNode cannot be set to nothing Treeview.SelectedNode cannot be set to nothing after calling Clear of the treeview (and Bug 1 occurs)
Workaround: You must set the SelectedNode to nothing BEFORE calling Clear or create a new treenode and set SelectedNode to the new treenode

3. XmlDocument.CreateNode(XmlNodeType, String, String) specifying a namespace as third parameter creating an element node will set the namespaceURI, but no 'xmlns' attribute is added (after save and load the attribute exists). A namespaceURI in the XMLnode is created, but no 'xmlns' attribute is added. This is contrary to W3C spec.
Workaround: Save the XMLDocument and reload it. Then the attribute exists.

4. a: XmlDocument.CreateNode(XmlNodeType, String, String) creating an attribute node and specifying a namespace without prefix, but adds automatically a prefix in the XmlNode.OuterXml property (i.e. d0p1). The XmlDocument.OuterXml gives a different prefix (i.e. d2p1).
b: XmlDocument.CreateAttribut(String, String) produces the same behavior as above. The attribute node has the NamespaceURI as given (without prefix), but the OuterXML properties of XMLnode and XMLDocument add a prefix - different prefixes(!).

5. a: XmlDocument.CreateNode(XmlNodeType, String, String) creating an attribute node always throws exception if second parameter is 'xmlns' (illegal namespace).
b: XmlDocument.CreateAttribut(String, String) produces the same behavior as above.
c: XmlDocument.CreateAttribut(String) produces the same behavior as above.
Creating an attribute with name 'xmlns' throws an exception. It is not possible to create a xmlns-Attribute manually.

6. a: XmlDocument.CreateNode(XmlNodeType, String, String) creating an attribute node with qualified name (ns:name) set the name qualified, but the OuterXml property just uses the localname without prefix. Prefix gets lost during save.
b: XmlDocument.CreateAttribut(String, String) produces the same behavior as above.
c: XmlDocument.CreateAttribut(String) produces the same behavior as above.
The Attribute is created with a qualified name, localname and prefix are ok, but OuterXML just uses localname (without prefix). Namespace prefix gets lost during save.

7. (similiar to 6.) XmlDocument.CreateNode(XmlNodeType, String, String) creating an element node with qualified name (ns:name) sets the name qualified, but the OuterXml property just uses the localname without prefix. Prefix gets lost during save.
The Node is created with a qualified name, localname and prefix are ok, but OuterXML just uses localname (without prefix). Namespace prefix gets lost during save.

Keine Kommentare: