System.Collections.Generic.KeyNotFoundException 在 Facebook MVC 应用程序演示上
System.Collections.Generic.KeyNotFoundException on Facebook MVC Application demo
我实际上是在关注这篇文章来尝试开发 facebook 应用程序:http://www.asp.net/mvc/overview/getting-started/aspnet-mvc-facebook-birthday-app
当我启动该应用程序时,我首先收到授权弹出窗口,要求我访问信息,但是当我按 "Ok" 并 fb 加载我的页面时,出现以下异常:
[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) +134
Microsoft.AspNet.Facebook.Providers.DefaultFacebookPermissionService.GetUserPermissionsStatus(String userId, String accessToken) +79
Microsoft.AspNet.Facebook.Authorization.FacebookAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext) +3091
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
我试过两次设置项目,同样的问题。
我的 fb app id、app secret 和 app namespace 设置正确。
关于堆栈跟踪,我怀疑存在某种授权问题,但由于我是 fb 开发的新手,我不知道哪里出了问题,google 对我帮助不大。
有什么建议吗?
编辑 1
我已经更新了 facebook API 的 nuget 引用,因为我怀疑 FB 更改了他们的 API 并且库不知道权限状态的 return 代码...没有成功,还是一样的错误。
Microsoft.AspNet.Mvc.Facebook 库中存在问题。我修补了库并将修复程序发送给 review/integration 的 Asp Net Mvc Stack 团队。
一切都在票中解释:)
我实际上是在关注这篇文章来尝试开发 facebook 应用程序:http://www.asp.net/mvc/overview/getting-started/aspnet-mvc-facebook-birthday-app
当我启动该应用程序时,我首先收到授权弹出窗口,要求我访问信息,但是当我按 "Ok" 并 fb 加载我的页面时,出现以下异常:
[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) +134
Microsoft.AspNet.Facebook.Providers.DefaultFacebookPermissionService.GetUserPermissionsStatus(String userId, String accessToken) +79
Microsoft.AspNet.Facebook.Authorization.FacebookAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext) +3091
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
我试过两次设置项目,同样的问题。 我的 fb app id、app secret 和 app namespace 设置正确。 关于堆栈跟踪,我怀疑存在某种授权问题,但由于我是 fb 开发的新手,我不知道哪里出了问题,google 对我帮助不大。
有什么建议吗?
编辑 1
我已经更新了 facebook API 的 nuget 引用,因为我怀疑 FB 更改了他们的 API 并且库不知道权限状态的 return 代码...没有成功,还是一样的错误。
Microsoft.AspNet.Mvc.Facebook 库中存在问题。我修补了库并将修复程序发送给 review/integration 的 Asp Net Mvc Stack 团队。 一切都在票中解释:)