用的NullReferenceException Owin [英] NullReferenceException with Owin
问题描述
我刚刚克隆一个项目,一个新的机器,我得到一个难以调试的NullReferenceException
在一个MVC站点OWIN:
I've just cloned a project to a new machine and I'm getting a hard-to-debug NullReferenceException
on a MVC site with OWIN:
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.Owin.Security.Cookies.<AuthenticateCoreAsync>d__0.MoveNext() +664
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24
Microsoft.Owin.Security.Infrastructure.<BaseInitializeAsync>d__2.MoveNext() +860
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter.GetResult() +21
Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +427
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
Microsoft.Owin.Host.SystemWeb.Infrastructure.ErrorState.Rethrow() +33
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +150
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +42
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +415
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
之后
[assembly: OwinStartupAttribute(typeof(Website.Startup))]
namespace Website
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
不过这就像我可以为F10ing分辨这引发异常后 - 它从来没有到达第一个控制器的构造
but that's as much as I can discern as F10ing after this throws the exception - it never reaches the constructor of the first controller.
有没有人经历过这种前和/或可以点我在什么可能是错误的原因的方向是什么?
Has anyone experienced this before and/or can point me in the direction of what could be the cause of the error?
推荐答案
从V2至V3似乎解决这个问题更新OWIN。
Updating OWIN from v2 to v3 seems to fix this issue.
这是值得注意的是,所有相关的OWIN包也应该被更新。
It's worth noting that all OWIN related packages should be updated too.
这篇关于用的NullReferenceException Owin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!