2013-11-26 52 views
0

我使用VS2K13中的Web向导(在Windows8.1 X64上)生成了一个新的MVC5应用程序,并启用了Facebook和Google登录项目。在我的测试中,只有Facebook登录工作和谷歌一直失败。我认为Microsoft.Owin中存在一个错误。MVC5:Google登录失败

我在Asp.net上问了同样的问题,到目前为止还没有有效的答案。似乎没有人知道在asp.net上的错误是什么。

下面是调试输出:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. 

Source Error: 


Line 197:  public async Task<ActionResult> ExternalLoginCallback(string returnUrl) 
Line 198:  { 
Line 199:   var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); 
Line 200:   if (loginInfo == null) 
Line 201:   { 


Source File: c:\downloads\web\projects\TestMvc5\TestMvc5\Controllers\AccountController.cs Line: 199 

Stack Trace: 



[NullReferenceException: Object reference not set to an instance of an object.] 
    Microsoft.Owin.Security.AuthenticationManagerExtensions.GetExternalLoginInfo(AuthenticateResult result) +189 
    Microsoft.Owin.Security.<GetExternalLoginInfoAsync>d__7.MoveNext() +362 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 
    System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24 
    TestMvc5.Controllers.<ExternalLoginCallback>d__25.MoveNext() in c:\downloads\web\projects\TestMvc5\TestMvc5\Controllers\AccountController.cs:199 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 
    System.Runtime.CompilerServices.TaskAwaiter.GetResult() +21 
    lambda_method(Closure , Task) +64 
    System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task) +37 
    System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +114 
    System.Web.Mvc.Async.<>c__DisplayClass34.<BeginInvokeAsynchronousActionMethod>b__33(IAsyncResult asyncResult) +65 
    System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +47 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +136 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49 
    System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c() +117 
    System.Web.Mvc.Async.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e() +323 
    System.Web.Mvc.Async.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult) +44 
    System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +47 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +136 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50 
    System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +72 
    System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(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() +139 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 
    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() +139 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 
    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__4(IAsyncResult asyncResult, ProcessRequestState innerState) +39 
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70 
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +139 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 
    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() +9688704 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 

回答

2

我们有同样的问题。我们确实发现,只有当用户没有定义名字和姓氏时才会发生这种情况。一旦用户有这个定义,然后错误不会发生。如果您发现问题,我们希望您发布答案。

+0

感谢您的评论。你找到了问题的原因。我会向微软报告这个错误。 – user2876023