MSXML2 和 .net - 旧代码

发布于 2024-11-20 00:31:53 字数 416 浏览 7 评论 0原文

我们有一个使用 MSXML2 和 vb6 的遗留代码,可以正常工作。最近,我们将项目转换为 VB.NET,当 xml 变大时,我们遇到了 msxml 的问题 - 基本上它挂起了。 在谷歌上搜索这个问题后,我们发现这篇文章说.NET应用程序不支持使用MSXML http://support.microsoft.com/kb/815112

我想知道是否有人知道第三个party 组件可以模仿 msxml 的功能,但仍然可以与 .NET 一起使用。另一种选择是重写代码的那些部分(使用 system.xml 或 linq),这是非常痛苦的,因为我们的应用程序中广泛使用了 MSXML。

谢谢, 皮尼。

We have a legacy code that uses MSXML2 with vb6 that works fine. Lately we converted the project to VB.NET and we are experiencing issues with the msxml when the xml getting big - basically it hung.
After googling the issue we found this article that says The use of MSXML is not supported in .NET applications
http://support.microsoft.com/kb/815112

I wonder if anyone know of a third party component that can imitate what msxml does but still can work with .NET . The other option is to rewrite those parts of code (using system.xml or linq) are very painful because the extensive use of MSXML in our application.

Thanks,
Pini.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫七 2024-11-27 00:31:53

不幸的是没有,我从来没有听说过。 Microsoft 确实有另一个名为 XmlLite 有时听起来它适用于托管代码,但有时则不然。我从未尝试过,但它可能至少值得研究。否则,您唯一的选择就是不升级到 .Net 或迁移到托管 XML。 MS 确实有一篇文章可能对您有帮助,如何:使用 Visual C# .NET 在 System.xml 中实现常见 MSXML 任务

但是,如果您确实决定在托管中重写,因为您使用的是 VB.Net,我强烈建议您查看 XML 文字。使用 XML 时非常简单。

Unfortunately no, not that I've ever heard of. Microsoft does have another utility out there called XmlLite that sometimes sounds like it works with managed code but sometimes not. I've never tried it but its probably worth at least investigating. Otherwise your only options are to not upgrade to .Net or to migrate to managed XML. MS does have an article that might help you, HOW TO: Implement Common MSXML Tasks in System.xml By Using Visual C# .NET.

But if you do decide to re-write in managed, since you're using VB.Net I'd highly recommend looking into XML Literals. XML is insanely easy when using them.

天赋异禀 2024-11-27 00:31:53

我没有丰富的从 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              |
+-------------------------------------+-------------------------------------+

如果你很幸运,你可以用旧的替换新的并运行它。

I don't have extensive experience updating from MSXML to System.XML, but so far I've found the two to be remarkably similar. That might be luck, if the footprint of MSXML my code was using just happened to be relatively small.

As far as it goes, Mobilize.NET published a guide mapping some common classes (not sure if it is 100% comprehensive) between the two, which I have found to be accurate:

+-------------------------------------+-------------------------------------+
|                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              |
+-------------------------------------+-------------------------------------+

If you're very lucky you can just substitute old for new and run it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文