C# 字典中不存在给定的键(在fb canvas页面教程之后)

C# 字典中不存在给定的键(在fb canvas页面教程之后),c#,asp.net-mvc,facebook,C#,Asp.net Mvc,Facebook,我完全按照教程进行操作,但是当我运行项目时,它给了我一个错误,说给定的键在字典中不存在。当我到目前为止在项目中几乎什么都没做的时候,有没有关于这是如何发生的想法 以下是堆栈跟踪: [KeyNotFoundException: The given key was not present in the dictionary.] System.Collections.Generic.Dictionary`2.get_Item(TKey key) +11165993 Microsoft.AspNet.F

我完全按照教程进行操作,但是当我运行项目时,它给了我一个错误,说给定的键在字典中不存在。当我到目前为止在项目中几乎什么都没做的时候,有没有关于这是如何发生的想法

以下是堆栈跟踪:

[KeyNotFoundException: The given key was not present in the dictionary.]
System.Collections.Generic.Dictionary`2.get_Item(TKey key) +11165993
Microsoft.AspNet.Facebook.PermissionsStatus.ConvertApiResult(IList`1 apiResults) +189
Microsoft.AspNet.Facebook.PermissionsStatus..ctor(IList`1 apiResult) +68

Microsoft.AspNet.Facebook.Providers.DefaultFacebookPermissionService.GetUserPermissionsStatus(String userId, String accessToken) +261
Microsoft.AspNet.Facebook.Authorization.FacebookAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext) +5655
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +143
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +1680
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +59
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +94
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +559
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +82
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +105
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +588
System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +47
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +65
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +139
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +484
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +50
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +98
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +151
System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +106
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +446
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +88
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +50
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +834
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +188

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009
[KeyNotFoundException:字典中不存在给定的键。]
System.Collections.Generic.Dictionary`2.get_项(TKey)+11165993
Microsoft.AspNet.Facebook.PermissionsStatus.ConvertApiResult(IList`1 apiResults)+189
Microsoft.AspNet.Facebook.PermissionsStatus..ctor(IList`1 apireult)+68
Microsoft.AspNet.Facebook.Providers.DefaultFacebookPermissionService.GetUserPermissionsStatus(字符串userId,字符串accessToken)+261
Microsoft.AspNet.Facebook.Authorization.FaceBookAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)+5655
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext ControllerContext,IList`1 filters,ActionDescriptor ActionDescriptor)+143
System.Web.Mvc.Async.c__显示类21.b__19(AsyncCallback AsyncCallback,Object asyncState)+1680
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback回调,对象callbackState)+59
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(异步回调,对象状态,Int32超时)+151
System.Web.Mvc.Async.AsyncResultRapper.Begin(AsyncCallback回调,对象状态,BeginInvokeDelegate beginDelegate,EndInvokeDelegate`1 endDelegate,对象标记,Int32超时)+94
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext ControllerContext,String actionName,AsyncCallback回调,对象状态)+559
System.Web.Mvc.Controller.b_uu1c(AsyncCallback-AsyncCallback,Object-asyncState,executeRecreat-innerState)+82
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback回调,对象callbackState)+73
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(异步回调,对象状态,Int32超时)+151
System.Web.Mvc.Async.AsyncResultRapper.Begin(AsyncCallback回调,对象callbackState,BeginInvokeDelegate`1 beginDelegate,EndInvokeVoidDelegate`1 endDelegate,TState invokeState,对象标记,Int32超时,SynchronizationContext callbackSyncContext)+105
System.Web.Mvc.Controller.BeginExecuteCore(异步回调,对象状态)+588
System.Web.Mvc.Controller.b_uu14(异步回调、异步回调、对象回调、控制器控制器)+47
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback回调,对象callbackState)+65
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(异步回调,对象状态,Int32超时)+151
System.Web.Mvc.Async.AsyncResultRapper.Begin(AsyncCallback回调、对象callbackState、BeginInvokeDelegate`1 beginDelegate、EndInvokeVoidDelegate`1 endDelegate、TSState invokeState、对象标记、Int32超时、SynchronizationContext callbackSyncContext)+139
System.Web.Mvc.Controller.BeginExecute(RequestContext RequestContext,AsyncCallback回调,对象状态)+484
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext RequestContext,AsyncCallback回调,对象状态)+50
System.Web.Mvc.MvcHandler.b_uu4(AsyncCallback AsyncCallback,Object asyncState,ProcessRequestState innerState)+98
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback回调,对象callbackState)+73
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(异步回调,对象状态,Int32超时)+151
System.Web.Mvc.Async.AsyncResultRapper.Begin(AsyncCallback回调,对象callbackState,BeginInvokeDelegate`1 beginDelegate,EndInvokeVoidDelegate`1 endDelegate,TState invokeState,对象标记,Int32超时,SynchronizationContext callbackSyncContext)+106
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext,异步回调,对象状态)+446
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext HttpContext,异步回调,对象状态)+88
System.Web.Mvc.MvcHandler.System.Web.IHTTPassynchandler.BeginProcessRequest(HttpContext上下文,AsyncCallback cb,Object extraData)+50
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+834
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+188
版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.34009

Microsoft.AspNet.Mvc.Facebook库中出现问题。我修补了lib并将修复程序发送给AspNetMvcStack团队进行审查/集成。票上解释了一切:)


门票:

嗨,只是一个温和的建议。尽量保持结果/日志的格式,例如,这里我将结果放在文本区域。一般来说,试着跟随。你的原文读起来真的很痛苦。谢谢。我把它放在代码格式中,因为我认为这是应该用于堆栈跟踪的。堆栈溢出与此不同,您缩进四个空格以创建一个a或
块。遇到了完全相同的问题,您找到了解决方案吗?