2010-03-18 132 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

相關問題