【发布时间】:2011-05-16 05:49:49
【问题描述】:
我正在执行这段代码:
[CanvasAuthorize(Permissions = "user_about_me")]
public ActionResult About()
{
var fb = new FacebookWebClient();
dynamic result = fb.Get("me");
ViewData["Firstname"] = result.first_name;
ViewData["Lastname"] = result.last_name;
return View();
}
我得到以下异常..有什么想法吗?
“/”应用程序中的服务器错误。
操作可能会破坏运行时的稳定性。 说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.Security.VerificationException:操作可能会破坏运行时的稳定性。
来源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[VerificationException:操作可能会破坏运行时的稳定性。]
SimpleJson.SimpleJson.ParseValue(Char[] json, Int32& index, Boolean& success) +107
SimpleJson.SimpleJson.TryDeserializeObject(String json, Object& object) +212
SimpleJson.SimpleJson.DeserializeObject(String json) +84
Facebook.SimpleJsonSerializer.DeserializeObject(字符串 json)+112
Facebook.FacebookSignedRequest.TryParse(String secret, String signedRequestValue, Int32 maxAge, Double currentTime, Boolean throws) +3096
Facebook.FacebookSignedRequest.Parse(字符串秘密,字符串签名请求值)+445
Facebook.FacebookSignedRequest.GetSignedRequest(String appSecret, HttpContextBase httpContext) +931
Facebook.FacebookSession.GetSession(String appId, String appSecret, HttpContextBase httpContext, FacebookSignedRequest signedRequest) +1031
Facebook.FacebookSession.GetSession(String appId, String appSecret, HttpContextBase httpContext) +128
Facebook.Web.FacebookWebContext.get_Session() +317
Facebook.Web.FacebookWebContext.IsAuthenticated() +136
Facebook.Web.FacebookWebContext.IsAuthorized(String[] 权限) +186
Facebook.Web.Mvc.CanvasAuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext, IFacebookApplication 设置) +572
Facebook.Web.Mvc.FacebookAuthorizeAttributeBase.OnAuthorization(AuthorizationContext filterContext) +182
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext 控制器上下文,IList1 filters, ActionDescriptor actionDescriptor) +149
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +831
System.Web.Mvc.Controller.ExecuteCore() +136
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +233
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +68
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44
System.Web.Mvc.Async.<>c__DisplayClass81.b__7(IAsyncResult )+42
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +142
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, 对象标签) +54
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.c_DisplayClasse.b_d() +61
System.Web.Mvc.SecurityUtil.b_0(动作 f)+31
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(动作动作)+56
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +110
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +690
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +194
版本信息:Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.1 I
【问题讨论】:
标签: facebook-c#-sdk