我尝试开发一个简单的winform实用程序,它使用xml文件作为其数据库。我使用过VS 2008快递版,C#。
当此实用程序尝试写入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.
答案 0 :(得分:4)
听起来您正在针对.NET 3.5开发,但随后部署到仅具有.NET 2.0的计算机。那不行。
答案 1 :(得分:1)
不提供System.Xml.dll
&amp; System.Xml.Linq.dll
。它们是框架的一部分,应该已经存在于GAC中。确保用户计算机上安装了.NET 3.5 SP1。
答案 2 :(得分:1)
在此处填写:Facebook Toolkit 2.0 - Error when running it on a server with asp.net 2.0 installed
也许你的目标机器上有错误的.NET版本?
答案 3 :(得分:1)
在异常转储中发生了一些非常可疑的事情。调用堆栈清楚地表明它正在执行Linq代码,GetXmlReaderSettings()仅在System.Xml.Linq(.NET 3.5程序集)中可用。但是,程序集列表不显示此程序集。
实际上该列表看起来已损坏,请注意名为“4u_pgrmq”的条目。从之前已经列出的System.dll加载。
.NET版本号非常低,832应该在.NET 3.0时间范围内。可能的证据表明您已将3.5程序集添加到先前安装的版本中。
只需在机器上安装.NET 3.5 SP1即可解决这个问题。