我正在使用Newtonsoft.JSON庫的.NET 2.0 C#項目。當我檢查web.config文件時,所有程序集都引用2.0版本。NET 3.5意外的錯誤,幷包括
然而,當我部署服務器,我收到以下錯誤的:
Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 21: }
Line 22:
Line 23: Dictionary<string, string> config = JavaScriptConvert.DeserializeObject<Dictionary<string, string>>(jason);
Line 24:
Line 25: if (Request.Form["login"] == config["adminLogin"] && FormsAuthentication.HashPasswordForStoringInConfigFile(Request.Form["password"], "sha1") == config["adminPass"])
Source File: c:\Website\WSRecrut\Test\ConnectionPost.aspx Line: 23
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.]
Newtonsoft.Json.Utilities.CollectionUtils.CreateDictionaryWrapper(Object dictionary) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\Utilities\CollectionUtils.cs:422
Newtonsoft.Json.JsonSerializer.CreateObject(JsonReader reader, Type objectType, Object existingValue) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\JsonSerializer.cs:223
Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\JsonSerializer.cs:169
Newtonsoft.Json.JavaScriptConvert.DeserializeObject(String value, Type type, JsonConverter[] converters) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\JavaScriptConvert.cs:512
Newtonsoft.Json.JavaScriptConvert.DeserializeObject(String value, JsonConverter[] converters) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\JavaScriptConvert.cs:485
Newtonsoft.Json.JavaScriptConvert.DeserializeObject(String value) in D:\Newtonsoft\Projects\Json\trunk\Src\Newtonsoft.Json\JavaScriptConvert.cs:457
ASP.connectionpost_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Website\WSRecrut\Test\ConnectionPost.aspx:23
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2113547
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896
沒有任何人有一個想法? 3.5上的組件可以從哪裏來?
馬克,我使用正確的.NET 2.0牛頓軟件庫。當使用Visual Studio 2008編譯.NET 2.0時,不會顯示錯誤。 – 2012-07-17 06:00:53
其實Newtonsoft圖書館是舊的,當我切換到最新的2.0 comptabile都工作正常。謝謝。 – 2012-07-17 12:48:10