XmlDocument.Load()中的System.NullReferenceException

编程入门 行业动态 更新时间:2024-10-25 15:26:29
本文介绍了XmlDocument.Load()中的System.NullReferenceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在加载XML文档时发生了一个奇怪的错误: 代码是: //创建一个文件 XmlDocument myDoc = new XmlDocument(); //并从文件中加载 myDoc。加载(文件名); .Load()内部我得到一个System.NullReferenceException大约1个 的10次运行(总是相同的xml文件)。 如果发生异常,堆栈似乎已损坏,因为我看不到 的callstack但有趣的是第二个线程(我的应用程序)这是一个例外的原因。 这是一个已知的错误或问题吗? 我在Visual Studio 2003下使用.NET Framework 1.1。 谢谢 doc

Hi, I have a strange error that occurs on loading an XML document: The code is: // create a document XmlDocument myDoc = new XmlDocument(); // and load it from file myDoc.Load(filename); Inside of .Load()I am getting a System.NullReferenceException in about 1 out of 10 runs (always the same xml file). If the exception occurs, the stack seems to be corrupt since I can not see the callstack but interesting enough a second thread (my app is single threaded) which seems the cause of the exception. Is this a known bug or issue? I am using .NET Framework 1.1 under Visual Studio 2003. thanks doc

推荐答案

我想补充一些细节: 主题列表: 3592< No Name> ** MyApp **。数据字典正常0 I''d like to add some details: Threadlist: 3592 <No Name> **MyApp**.DataDictionary Normal 0 > 4028< No Name>最高0 >4028 <No Name> Highest 0

崩溃发生在4028线程中。 任何人都有任何想法吗? 谢谢 doc

The crash occurs in the 4028 thread. Anyone any idea? Thanks doc

如何指定文件名。我的意思是完整路径或相对路径和 是否有相同代码中的任何其他文件访问。 docschnipp写道: how do u specify the file name. i mean full path or relative path and is there any other file access in the same code. docschnipp wrote: 我想补充一些细节: 主题列表: 3592< No Name> ** MyApp **。数据字典正常0 I''d like to add some details: Threadlist: 3592 <No Name> **MyApp**.DataDictionary Normal 0 4028< No Name>最高0 4028 <No Name> Highest 0

崩溃发生在4028线程中。 任何人都有任何想法吗? 谢谢 doc

The crash occurs in the 4028 thread. Anyone any idea? Thanks doc

" knowdotnet"写道: "knowdotnet" wrote: 你如何指定文件名。我的意思是完整路径或相对路径和 是否在同一代码中有任何其他文件访问权限。 how do u specify the file name. i mean full path or relative path and is there any other file access in the same code.

这是一个字符串,只是名字,在同一目录中。 应用程序不是很复杂。 它总是一样的,但有时它只是崩溃。 XML文件本身总是一样的。 但是它有时会崩溃。 doc

It is a string, name only, in the same directory. The app is not very complex. It is just always the same, but sometimes it just crashes. The XML file itself is always the same. But it crashes sometimes. doc

更多推荐

XmlDocument.Load()中的System.NullReferenceException

本文发布于:2023-11-17 03:26:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608649.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Load   XmlDocument   NullReferenceException   System

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!