问题描述
使用ServiceStack.Ormlite的异步API时,我不断收到NullReferenceException。我真的不知道该从哪里去,我不得不承认我要疯了一半
我知道的是,将await db.SelectAsync<T>(sqlString,parameters);
切换为db.Select<T>(sqlString,parameters);
可以解决问题。
任务
堆栈跟踪
at System.Web.threadcontext.AssociateWithCurrentThread(Boolean setImpersonationContext)
at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext)
at System.Web.LegacyAspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback,Object state)
at System.Web.LegacyAspNetSynchronizationContext.CallCallback(SendOrPostCallback callback,Object state)
at System.Web.LegacyAspNetSynchronizationContext.Post(SendOrPostCallback callback,Object state)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.PostAction(Object state)
at System.Threading.Tasks.AwaitTaskContinuation.runcallback(ContextCallback callback,Object state,Task& currentTask)
--- End of stack trace from prevIoUs location where exception was thrown ---
at System.Threading.Tasks.AwaitTaskContinuation.<>c.<ThrowAsyncIfNecessary>b__18_0(Object s)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)