【问题标题】:Monodroid: Exception in XmlDocument.SelectNodes() methodMonodroid:XmlDocument.SelectNodes() 方法中的异常
【发布时间】:2011-06-13 19:22:48
【问题描述】:

我正在为一些应该很简单但导致意外异常的 Monodroid 代码苦苦挣扎。当我尝试在 XmlDocument 对象上调用 SelectNodes() 时,代码会引发异常。

这是代码:

XmlDocument handXmlDocument = new XmlDocument();

XmlDeclaration dec = handXmlDocument.CreateXmlDeclaration("1.0", null, null);

handXmlDocument.AppendChild(dec);

XmlElement root = handXmlDocument.CreateElement("friendslist");

handXmlDocument.AppendChild(root);

XmlElementfriendElement = handXmlDocument.CreateElement("friend");

friendElement.SetAttribute("locationx", "35");

friendElement.SetAttribute("locationy", "46");

friendElement.SetAttribute("电话", "4085556803");

root.AppendChild(friendElement);

XmlNodeListfriendNodeList = handXmlDocument.SelectNodes("/friendslist/friend");

这里是个例外:

E/mono (365): [0x45eec0:] 异常处理: System.TypeInitializationException: System.Console 的类型初始化程序抛出异常 E/FriendsView(365):解析 XML 文档的异常:System.Console 的类型初始化程序引发了异常 E/FriendsView(365):解析 XML 文档的内部异常:System.ExecutionEngineException:SIGILL E/FriendsView(365): 在 System.Console..cctor () [0x00019] 在 /Users/plasma/Work/mono-android-trunk/mcs/class/corlib/System/Console.cs:127

我不知道为什么 System.Console 在这里涉及!感谢您的帮助,马丁

【问题讨论】:

  • 产品处于测试阶段,请在邮件列表或 Monodroid 错误跟踪器上报告错误。

标签: exception xmldocument xamarin.android selectnodes


【解决方案1】:

只是添加这个,希望它可以帮助遇到同样问题的其他人。事实证明,这是 Monodroid 1.0.8980 中的一个错误,在 Monodroid 1.0.9186 时已修复。升级到新版本解决了我的问题。

【讨论】:

    猜你喜欢
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 2017-08-05
    • 2014-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    相关资源
    最近更新 更多