2014-01-30 52 views
-1

我有這樣的錯誤:獲取錯誤沒有所有的附加節目信息只顯示異常

unable to perform backup.....System.IO.FileLoadException: Could not load file or 
Assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, 
PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's 
manifest  
definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
File name: 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, 
PublicKeyToken=30ad4fe6b2a6aeed' 
    at Dropbox.Api.DropboxApi.ParseJson[T](String json) 
    at Dropbox.Api.DropboxApi.GetFiles(String root, String path) 
at AndroBackupUtility.Form1.inc_filekeep() in 
c:\Users\shanem.CAN\Source\Workspaces\Workspace\Andromeda 
backup\Main\AndroBackupUtility\AndroBackupUtility\Form1.cs:line 270 
at AndroBackupUtility.Form1.dropboxup(String curbackdir, String backupfilename, String 
logfile, String foldname) in c:\Users\shanem.CAN\Source\Workspaces\Workspace\Andromeda 
Backup\Main\AndroBackupUtility\AndroBackupUtility\Form1.cs:line 399 
at AndroBackupUtility.Form1.inc_backup() in 
c:\Users\shanem.CAN\Source\Workspaces\Workspace\Andromeda 
Backup\Main\AndroBackupUtility\AndroBackupUtility\Form1.cs:line 239 
at AndroBackupUtility.Form1.incremental_Elapsed(Object sender, EventArgs e) in 
c:\Users\shanem.CAN\Source\Workspaces\Workspace\Andromeda 
Backup\Main\AndroBackupUtility\AndroBackupUtility\Form1.cs:line 144 

我想什麼是減少誤差降低到類似:

System.IO.FileLoadException: Could not load file or Assembly 

我怎麼能管理?

回答

4

這樣,假設你有一個例外ex

string.Format("{0}: {1}", ex.GetType(), ex.Message); 

注意,它仍然會留下整個郵件,所以你會得到:

System.IO.FileLoadException:可能不加載文件或 程序集'Newtonsoft.Json,Version = 4.0.5.0,Culture = neutral, PublicKeyToken = 30ad4fe6b2a6aeed'或它的一個依賴關係。清單定義的程序集 與程序集引用不匹配。 (異常來自HRESULT:0x80131040)

這裏沒有砍倒它的任何短的標準方法 - 你可以只截斷它,但可能不會留下足夠的信息,一些消息。

相關問題