2010-03-18 139 views
0

我试过开发​​一个使用xml文件作为数据库的简单winform工具。我已经使用VS 2008快速版,C#。.NET异常错误,这个错误是什么意思?

当此实用程​​序尝试写入xml文件时,此错误显示在其他计算机上。我试图在另一台计算机上的同一文件夹中提供System.Xml.dll & System.Xml.Linq.dll,但没用。

这是什么意思?任何解决方案

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box. 

************** Exception Text ************** 
System.MissingMethodException: Method not found: 'Void System.Xml.XmlReaderSettings.set_MaxCharactersFromEntities(Int64)'. 
    at System.Xml.Linq.XNode.GetXmlReaderSettings(LoadOptions o) 
    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) 
    at System.Xml.Linq.XDocument.Load(String uri) 
    at Issues.Form1.button1_Click(Object sender, EventArgs e) 
    at System.Windows.Forms.Control.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
    at System.Windows.Forms.Control.WndProc(Message& m) 
    at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
    at System.Windows.Forms.Button.WndProc(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 


************** Loaded Assemblies ************** 
mscorlib 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll 
---------------------------------------- 
Issues 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file:///C:/Documents%20and%20Settings/sumsnl.LTSLFBD/Desktop/Process%20Improvement/Issues%20Register/Issues.exe 
---------------------------------------- 
System.Windows.Forms 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 
System 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 
System.Drawing 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
System.Xml 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll 
---------------------------------------- 
System.Configuration 
    Assembly Version: 2.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
---------------------------------------- 
4u_pgrmq 
    Assembly Version: 1.0.0.0 
    Win32 Version: 2.0.50727.832 (QFE.050727-8300) 
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 

************** JIT Debugging ************** 
To enable just-in-time (JIT) debugging, the .config file for this 
application or computer (machine.config) must have the 
jitDebugging value set in the system.windows.forms section. 
The application must also be compiled with debugging 
enabled. 

For example: 

<configuration> 
    <system.windows.forms jitDebugging="true" /> 
</configuration> 

When JIT debugging is enabled, any unhandled exception 
will be sent to the JIT debugger registered on the computer 
rather than be handled by this dialog box. 

回答

1

不提供System.Xml.dll & System.Xml.Linq.dll。它们是框架的一部分,应该已经存在于GAC中。确保用户计算机上安装了.NET 3.5 SP1。

4

这听起来像你正在开发针对.NET 3.5,但随后部署到只有.NET 2.0的机器。这是行不通的。

1

形式在这里:Facebook Toolkit 2.0 - Error when running it on a server with asp.net 2.0 installed

也许你有你的目标机器上的错误.NET版本?

+0

我在学习用C#编写代码的初始阶段,你如何建议我在客户端计算机上处​​理这些事情? – gsvirdi 2010-03-18 11:17:19

+0

这不是一个真正的C#问题,更多的是客户端没有安装最新版本的.NET框架。如果你让他们去微软网站(http://www.microsoft.com/NET/),他们可以从那里下载。如果你使用的是VS2008,那么他们至少需要框架3.5 – Darbio 2010-03-18 23:32:08

1

在异常转储中发生了非常可怕的事情。调用堆栈清楚地表明它正在执行Linq代码,GetXmlReaderSettings()仅在.NET 3.5程序集System.Xml.Linq中可用。但程序集列表不显示此程序集。

事实上,该列表看起来已损坏,请注意名为“4u_pgrmq”的条目。已从之前列出的System.dll加载。

.NET修订号很低,832应该在.NET 3.0时间范围内。可能的证据表明您已将3.5程序集添加到较早安装的版本。

通过简单地在机器上安装.NET 3.5 SP1解决此问题的可能性应该不错。

+0

作为开发者......我无法继续在客户端计算机上安装东西。我的实用程序只是几个控件来接受用户输入并将它们添加到xml文件中。 webbrowser控件显示xml,并在样式表文件的帮助下对其进行格式化。我不希望我的实用程序是一个装满程序集的安装包,这只是一个界面。任何更好的建议plz ????? – gsvirdi 2010-03-18 11:16:09

+0

在你看来,你做了你不应该做的事情就会陷入麻烦,在客户端计算机上安装像Linq这样的东西。如果无法说服系统管理员或用户更新机器的.NET版本,则必须停止使用XDocument等。你其实问过吗?如果机器只有.NET 1.1会怎么样?你有一个否,也许你会得到一个是的。 XDocument不是一个真正的问题,XmlDocument也完成了工作。 – 2010-03-18 12:08:46

+0

你如何建议处理这样的错误?我一直在阅读MSDN上的可用例外列表。但是没有成功.....我应该使用哪种例外来在客户机上显示这样的FrameWork错误? – gsvirdi 2010-03-23 06:04:22

相关问题