none
The ObjectContext... diye başlayan bir hata RRS feed

  • Genel Tartışma

  • mvc ile proje yapmaya çalışıyorum fakat, controller dan json ile veri çekmeye çalışırken aşağıdaki resimde bulunan hatayı alıyorum, bir kaç gündür bu hata ile uğraşıyorum, yardımcı olabilecek hocalardaın yardımını bekliyorum.

    Server Error in '/' Application.

    The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

    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.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 
    [ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.]
       System.Data.Entity.Core.Objects.ObjectContext.get_Connection() +5068841
       System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +111
       System.Data.Entity.Core.Objects.ObjectQuery`1.Execute(MergeOption mergeOption) +31
       System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(List`1 collection, MergeOption mergeOption) +134
       System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(MergeOption mergeOption) +30
       System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad() +350
       System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty(TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject) +85
       System.Data.Entity.Core.Objects.Internal.<>c__DisplayClass7`2.<GetInterceptorDelegate>b__1(TProxy proxy, TItem item) +105
       System.Data.Entity.DynamicProxies.Drink_977799A9D96F4849D97806A88CC82A460AC26664CDE09ADAAA50368E1D00FF40.get_FoodMenu() +75
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
       System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
       System.Web.SecurityUtils.MethodInfoInvoke(MethodInfo method, Object target, Object[] args) +162
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +749
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +2751
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +371
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +186
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +2699
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +371
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +57
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +83
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) +44
       System.Web.Mvc.JsonResult.ExecuteResult(ControllerContext context) +817
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +116
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +529
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +106
       System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +321
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185
       System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +42
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +34
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +37
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44
       System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +39
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +62
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +37
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +39
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
       System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +37
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9644037
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0


    26 Mayıs 2016 Perşembe 11:27

Tüm Yanıtlar

  • Mevcut kodlarini paylasirsan kodun uzerinde hatayi bulmanda yardimci olmaya calisayim. ve ayrica sormak istiyorum Lazy loading kullaniyor musun?


    Birinin cevabı size yardımcı oldu ise, l&amp;#252;tfen &amp;amp;quot;Yanıt Olarak &amp;#214;ner&amp;amp;quot; veya &amp;amp;quot;Yanıt Olarak İşaretle&amp;amp;quot; olarak isaretlemeyi ve Oy vermeyi unutmayınız. Burada sağlanan t&amp;#252;m g&amp;#246;r&amp;#252;şler, kişiseldir ve Microsoft&amp;#39;un konumunu temsil etmemektedir. T&amp;#252;m bilgiler hazır olarak temin edilmektedir ve herhangi bir garanti vermemektedir.

    27 Mayıs 2016 Cuma 11:09
    Moderatör