Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JwtSecurityTokenHandler.set_CertificateValidator method not found

Just updated many of the packages for an Azure Mobile Service and now I get a "method not found" error. This does not seem to be a problem reported elsewhere yet. Any idea which package needs to be down-graded? Or another work-around?

[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
like image 499
Wavel Avatar asked Oct 27 '14 20:10

Wavel


1 Answers

Ive just had the same issue and have got the Mobile Service working again by

In Package Manager Console in VS

uninstall-package WindowsAzure.MobileServices.Backend.Entity

uninstall-package WindowsAzure.MobileServices.Backend.Tables

uninstall-package WindowsAzure.MobileServices.Backend

then

install-package WindowsAzure.MobileServices.Backend -Version 1.0.342

install-package WindowsAzure.MobileServices.Backend.Tables -Version 1.0.342

install-package WindowsAzure.MobileServices.Backend.Entity -Version 1.0.342

Not sure why this is happening though

like image 119
SWilko Avatar answered Dec 12 '22 16:12

SWilko