我们有一个遗留代码,它使用MSXML2和vb6,运行良好。最近,我们将项目转换为VB.NET,当xml变得很大时,我们遇到了msxml的问题--基本上是挂起的。在搜索了这个问题之后,我们发现这篇文章说在应用程序 http://support.microsoft.com/kb/815112中不支持使用MSXML。
我想知道是否有人知道第三方组件可以模仿msxml的功能,但仍然可以使用.NET。另一种选择是重写代码的这些部分(使用system.xml或linq)非常痛苦,因为MSXML在我们的应用程序中的广泛使用。
谢谢皮尼。
发布于 2020-01-09 19:41:22
我没有从MSXML升级到System.XML的丰富经验,但到目前为止,我发现这两者非常相似。这可能是幸运的,如果我的代码所使用的MSXML占用空间恰好相对较小的话。
就目前而言,Mobilize.NET发布了一份指南,在这两个类之间映射了一些常见的类(不确定它是否100%的全面性),我发现这是准确的:
+-------------------------------------+-------------------------------------+
| Class | Maps To |
+-------------------------------------+-------------------------------------+
| MSXML2.DOMDocument | System.Xml.XmlDocument |
| MSXML2.DOMNodeType | System.Xml.XmlNodeType |
| MSXML2.IXMLDOMAttribute | System.Xml.XmlAttribute |
| MSXML2.IXMLDOMCDATASection | System.Xml.XmlCDataSection |
| MSXML2.IXMLDOMDocument | System.Xml.XmlDocument |
| MSXML2.IXMLDOMElement | System.Xml.XmlElement |
| MSXML2.IXMLDOMNamedNodeMap | System.Xml.XmlNamedNodeMap |
| MSXML2.IXMLDOMNode | System.Xml.XmlNode |
| MSXML2.IXMLDOMNodeList | System.Xml.XmlNodeList |
| MSXML2.IXMLDOMParseError | System.Exception |
| MSXML2.IXMLDOMText | System.Xml.XmlCharacterData |
| MSXML2.tagDOMNodeType | System.Xml.XmlNodeType |
| MSXML2.IXMLDOMCharacterData | System.Xml.XmlCharacterData |
| MSXML2.IXMLDOMDocumentFragment | System.Xml.XmlDocumentFragment |
| MSXML2.IXMLDOMComment | System.Xml.XmlComment |
| MSXML2.IXMLDOMEntity | System.Xml.XmlEntity |
| MSXML2.IXMLDOMEntityReference | System.Xml.XmlEntityReference |
| MSXML2.IXMLDOMImplementation | System.Xml.XmlImplementation |
| MSXML2.IXMLDOMNotation | System.Xml.XmlNotation |
| MSXML2.IXMLDOMProcessingInstruction | System.Xml.XmlProcessingInstruction |
| MSXML2.IXMLDOMDocumentType | System.Xml.XmlDocumentType |
| MSXML2.FreeThreadedDOMDocument | System.Xml.XmlDocument |
| MSXML2.FreeThreadedDOMDocument40 | System.Xml.XmlDocument |
| MSXML2.DOMDocument40 | System.Xml.XmlDocument |
+-------------------------------------+-------------------------------------+如果你很幸运的话,你可以用旧的代替新的,然后运行它。
https://stackoverflow.com/questions/6681879
复制相似问题