我正在使用 Microsoft.AspNet.Authentication.JwtBearer version 1.0.0-rc1-final

这一行:

JwtBearerOptions bearerOptions = new JwtBearerOptions( );

获取 ArrayTypeMismatchException ,这是堆栈跟踪 . 有什么线索吗?

这是堆栈跟踪:

应用程序启动异常:System.Reflection.TargetInvocationException:调用目标已抛出异常 . ---> System.ArrayTypeMismatchException:尝试将元素作为与数组不兼容的类型进行访问 . 在System.Collections.Generic.List`1.Add(T item)中的Microsoft.AspNet.Authentication.JwtBearer.JwtBearerOptions..ctor()在ActiveCypherUserAuthAPI.Startup.Configure(IApplicationBuilder app,IHostingEnvironment env,ILoggerFactory loggerFactory)中的D: \ home \ site \ approot \ src \ ActiveCypherUserKeyAPI \ Startup.cs:第126行---内部异常堆栈跟踪结束---在System.RuntimeMethodHandle.InvokeMethod(对象目标,Object []参数,签名sig,布尔构造函数)在System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,Object []参数,Object []参数)在Microsoft的System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo文化)位于Microsoft.AspNet.Hosting.Internal.AutoRequestServicesStart的Microsoft.AspNet.Hosting.Startup.ConfigureBuilder . <> c__DisplayClass4_0.b__0(IApplicationBuilder builder)的.AspNet.Hosting.Startup.ConfigureBuilder.Invoke(对象实例,IApplicationBuilder构建器) . Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()中的upFilter . <> c__DisplayClass0_0.b__0(IApplicationBuilder构建器)失败:Microsoft.AspNet.Hosting.Internal.HostingEngine [7]

编辑:

JwtBearerOptions类构造函数抛出异常 . 上面显示的单行代码是使用Microsoft.ApsNet.Authentication的1.0.0-rc1-final版本时重现错误所需的全部代码 . 构造函数中的某些内容失败了 . 我的问题不是“什么是ArrayType不匹配” . 我的问题是为什么构造函数失败并且有一个解决方法 .