Azure mobile services 未找到JwtSecurityTokenHandler.set_CertificateValidator方法

Azure mobile services 未找到JwtSecurityTokenHandler.set_CertificateValidator方法,azure-mobile-services,Azure Mobile Services,刚刚更新了Azure移动服务的许多软件包,现在我遇到了一个“找不到方法”错误。这似乎还不是其他地方报道的问题。你知道哪个包裹需要降级吗?还是其他的工作 [MissingMethodException: Method not found: 'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateVa

刚刚更新了Azure移动服务的许多软件包,现在我遇到了一个“找不到方法”错误。这似乎还不是其他地方报道的问题。你知道哪个包裹需要降级吗?还是其他的工作

[MissingMethodException: Method not found: 'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateValidator)'.]
       Microsoft.WindowsAzure.Mobile.Service.Security.Providers.GoogleLoginProvider..ctor(HttpConfiguration config, IServiceTokenHandler tokenHandler) +0
       lambda_method(Closure , Object[] ) +174
       Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +419

    [DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.Web.Http.HttpConfiguration, Microsoft.WindowsAzure.Mobile.Service.Security.IServiceTokenHandler)' on type 'GoogleLoginProvider'. ---> Method not found: 'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateValidator)'. (See inner exception for details.)]
       Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +999
       Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +589
       Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +109
       Autofac.Core.Resolving.InstanceLookup.<Execute>b__0() +63
       Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +201
       Autofac.Core.Resolving.InstanceLookup.Execute() +262
       Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +282
       Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +72
       Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +60
       System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
       System.Linq.Buffer`1..ctor(IEnumerable`1 source) +335
       System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
       Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +256
       Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +191
       Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +109
       Autofac.Core.Resolving.InstanceLookup.Execute() +158
       Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +282
       Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +60
       Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +111
       Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +279
       Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +57
       Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) +175
       Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) +250
       Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters) +72
       Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) +63
       Microsoft.WindowsAzure.Mobile.Service.Config.AutofacDependencyScope.GetServices(Type serviceType) +269
       System.Web.Http.DependencyScopeExtensions.GetServices(IDependencyScope services) +172
       System.Web.Http.DependencyScopeExtensions.GetLoginProviders(IDependencyScope services) +41
       Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.ConfigureAuthentication(IAppBuilder appBuilder, HttpConfiguration config) +379
       Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.Configuration(IAppBuilder appBuilder) +70
       Microsoft.WindowsAzure.Mobile.Service.<>c__DisplayClass5.<ConfigureOwin>b__4(IAppBuilder appBuilder) +40
       Microsoft.WindowsAzure.Mobile.Service.Config.StartupOwinAppBuilder.Configuration(IAppBuilder appBuilder) +234
[MissingMethodException:找不到方法:'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set_CertificateValidator(System.IdentityModel.Selectors.X509CertificateValidator)'
Microsoft.WindowsAzure.Mobile.Service.Security.Providers.GoogleLoginProvider..ctor(HttpConfiguration配置,IServiceTokenHandler tokenHandler)+0
lambda_方法(闭包,对象[])+174
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()+419
[DependencyResolutionException:调用类型为'GoogleLoginProvider'的构造函数'Void.ctor(System.Web.Http.HttpConfiguration,Microsoft.WindowsAzure.Mobile.Service.Security.IServiceTokenHandler)'时引发异常。-->未找到方法:'Void System.IdentityModel.Tokens.JwtSecurityTokenHandler.set\U CertificateValidator'(System.IdentityModel.Selectors.X509CertificateValidator)“(有关详细信息,请参阅内部异常)。]
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()+999
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext上下文,IEnumerable`1参数)+589
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1参数)+109
Autofac.Core.Resolving.InstanceLookup.b_u0()+63
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id,Func`1 creator)+201
Autofac.Core.Resolving.InstanceLookup.Execute()+262
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope,IComponentRegistration,IEnumerable`1参数)+282
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration,IEnumerable`1参数)+72
Autofac.Features.Collections.c_uuu显示类6.b_uuu1(IComponentRegistration cr)+60
System.Linq.WhereSelectArrayIterator`2.MoveNext()+66
System.Linq.Buffer`1..ctor(IEnumerable`1源)+335
System.Linq.Enumerable.ToArray(IEnumerable`1源)+77
Autofac.Features.Collections.c__显示类4.b__0(IComponentContext c,IEnumerable`1p)+256
Autofac.Core.Activators.DelegateActivator.ActivateInstance(IComponentContext,IEnumerable`1参数)+191
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1参数)+109
Autofac.Core.Resolving.InstanceLookup.Execute()+158
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope,IComponentRegistration,IEnumerable`1参数)+282
Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration注册,IEnumerable`1参数)+60
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration,IEnumerable`1参数)+111
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration,IEnumerable`1参数)+279
Autofac.Core.Container.ResolveComponent(IComponentRegistration,IEnumerable`1参数)+57
Autofac.ResolutionExtensions.TryResolveService(IComponentContext上下文、服务服务、IEnumerable`1参数、对象和实例)+175
Autofac.ResolutionExtensions.ResolveService(IComponentContext上下文,服务服务,IEnumerable`1参数)+250
Autofac.ResolutionExtensions.Resolve(IComponentContext上下文,类型serviceType,IEnumerable`1参数)+72
Autofac.ResolutionExtensions.Resolve(IComponentContext上下文,类型serviceType)+63
Microsoft.WindowsAzure.Mobile.Service.Config.AutofacDependencyScope.GetServices(类型serviceType)+269
System.Web.Http.DependencyScopeExtensions.GetServices(IDependencyScope服务)+172
System.Web.Http.DependencyScopeExtensions.GetLoginProviders(IDependencyScope服务)+41
Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.ConfigureAuthentication(IAppBuilder appBuilder,HttpConfiguration Config)+379
Microsoft.WindowsAzure.Mobile.Service.Config.OwinAppBuilder.Configuration(IAppBuilder-appBuilder)+70
Microsoft.WindowsAzure.Mobile.Service.c__显示类5.b__4(IAppBuilder-appBuilder)+40
Microsoft.WindowsAzure.Mobile.Service.Config.StartupOwinAppBuilder.Configuration(IAppBuilder appBuilder)+234

我刚刚遇到了同样的问题,我已经让移动服务重新开始工作了

在VS中的包管理器控制台中

卸载程序包WindowsAzure.MobileServices.Backend.Entity

卸载程序包WindowsAzure.MobileServices.Backend.Tables

卸载程序包WindowsAzure.MobileServices.Backend

然后

安装软件包WindowsAzure.MobileServices.Backend-版本1.0.342

安装软件包WindowsAzure.MobileServices.Backend.Tables-版本1.0.342

安装软件包WindowsAzure.MobileServices.Backend.Entity-版本1.0.342


不确定为什么会发生这种情况,尽管更新ams nuget pkg后出现了相同的问题。 回退是可行的,但与其说是解决方案,不如说是一种变通办法


编辑:您可以回滚到405版本。

我的团队仍在调查此问题,我还没有所有信息,但到目前为止,我观察到更新到439不会触发此问题。您可以通过在visual studio中创建新的移动服务来验证这一点,然后进入NuGet并更新移动服务.NET后端实体框架包至最新版本(439)。 更新完成后,点击F5,您应该看到服务正常加载,没有任何错误

通过选择Microsoft.Owin.Security.ActiveDirecto,我可以重现该问题
install-package System.IdentityModel.Tokens.Jwt -version 3.0.2