2013-12-15 26 views
1

最近我開始使用John Papa http://www.johnpapa.net/hot-towel-angular/提供的HotTowel AngularJs BreezeJs模板。HotTowel模板擴展,使用BreezeJs保存數據庫更改的問題

我遇到了一個錯誤,我不能左右我的頭:從服務器獲取數據的工作沒有問題,但是當我嘗試調用的SaveChanges()我得到以下錯誤:

「消息= 「Newtonsoft.Json.Linq.JObject」不包含「實體」」

最接近的可能的答案的定義,我發現這個問題是來自:Exception when trying Breeze.js example in version 1.0.1,但我沒有找到Telerik的工作室的我的電腦上安裝。我還有許多其他Telerik產品,如Fiddle,JustCode和其他產品。我確實在GAC中安裝了Newtonsoft dll。根據我的理解,使用BreezeJS會導致錯誤,我想知道處理這些錯誤的最佳方法是什麼 - 我是否從GAC卸載dll,因此可能會破壞使用它的Telerik產品,或者有另一種方式周圍。

對於代碼本身,我使用實體框架,使用Code First在Windows Azure上創建數據庫。我按照John Papa的例子設置了一個存儲庫,並將它與BreezeController連接起來。正如我前面所說,所有的獲得者都能很好地工作,但是當我嘗試發佈某些東西時,我會遇到一個錯誤。在您可以找到完整的錯誤信息:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException was unhandled by user code 
    HResult=-2146233088 
    Message='Newtonsoft.Json.Linq.JObject' does not contain a definition for 'entities' 
    Source=Anonymously Hosted DynamicMethods Assembly 
    StackTrace: 
    at CallSite.Target(Closure , CallSite , Object) 
    at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site,T0  arg0) 
    at Breeze.ContextProvider.ContextProvider.SaveChanges(JObject saveBundle, TransactionSettings transactionSettings) 
    at CC.Dal.StudentHubRepository.SaveChanges(JObject saveBundle) in c:\Users\Georgi\Documents\Visual Studio 2012\Projects\LearningAngular.web\CC.Dal\StudentHubRepository.cs:line 26 
    at CC.Web.Controllers.BreezeController.SaveChanges(JObject saveBundle) in c:\Users\Georgi\Documents\Visual Studio 2012\Projects\LearningAngular.web\LearningAngular.web\Controllers\BreezeController.cs:line 27 
    at lambda_method(Closure , Object , Object[]) 
    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) 
    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) 
    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) 
    InnerException: 

在此先感謝您提供的任何信息。作爲幾年來StackOverflow的日常用戶,這是我實際發佈的第一個問題,希望能夠明確地闡述它。

編輯:我找到了解決辦法,每次在windows azure上發佈我的代碼並從那裏進行測試。我仍然無法測試本地,而且看起來確實是因爲Telerik在GAC中安裝了Newtonsoft dll。現在至少我的代碼是從服務器上運行的,但是對於解決方案的任何建議我都可以測試。

回答

0

您的應用程序中Telerik安裝的Newtonsoft版本可能與最新VS2013安裝的預期版本不一致。這發生了很多。 VS2013打破了許多安裝,你可能會落後Telerik的更新。我建議你跟Telerik談談他們將要加入GAC的Newtonsoft版本......如果這真的是問題所在。

FWIW,應該沒有這種性質的問題。您所描述的堆棧已知可在Azure中使用。

+0

我正在使用Visual Studio 2012運行SPA,最新的更新促進了很多。我認爲您在GAC中安裝的Newtonsoft lirabriers會造成某種類型的錯誤是正確的。當我將網站代碼上傳到Azure時,它可以很好地工作。 –