7

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
1
  • In general, it's not a good idea to update the packages in your backend project, because we have particular versions in our hosting environment that might not be compatible when you update.
    – lindydonna
    Dec 5, 2014 at 20:07

4 Answers 4

10

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

3
  • I still get the same error but using Azure AD. Tried a few versions including 342 and 405 but with no success. Has there been any feedback on this issue elsewhere? Nov 10, 2014 at 12:05
  • I've had the same issue. It is all to do with that System.IdentityModel.Tokens.Jwt, its caused nothing but issues from anything higher than 342. The MobileServices team just haven't referenced this dll correctly.
    – Adam
    Nov 12, 2014 at 13:38
  • 1
    install only WindowsAzure.MobileServices.Backend.Entity because it will install the others :) Nov 30, 2014 at 17:44
4

Ok guys, I finally found the problem thanks to Paul advises. It's because of System.IdentityModel.Tokens.Jwt 4.0.0 package version.

In fact, updating Microsoft.Owin.Security.ActiveDirectory package from 2.1.0 to 3.0.0 cause the Jwt package update from 3.0.2 to 4.0.0

The workaround is to restore both ActiveDirectory to 2.1.0 and Jwt to 3.0.2 then hit F5 and enjoy AMS 439.

install-package System.IdentityModel.Tokens.Jwt -version 3.0.2
0
2

Same problem here after updating ams nuget pkg. Rolling back worked but it's more a workaround than a solution.

Edit: You can rollback to 405 version.

1
  • Not yet. Also posted on MSDN forum and Git issue but not answered yet anywhere.
    – JeremyBP
    Nov 1, 2014 at 11:44
0

My team is still investigating this issue and I don't have all the information yet, but so far I've observed that updating to 439 does not trigger the issue. You can verify this yourself by creating a new mobile service in visual studio, then go into NuGet and update the Mobile Services .NET Backend Entity Framework package to the latest version (439). Once the update is complete, hit F5 and you should see that the service loads up normally without any errors.

I was able to reproduce the problem by selecting the Microsoft.Owin.Security.ActiveDirectory package and updating it from 2.1.0 to 3.0.0. Of course, selecting the "Update All" option in NuGet will achieve the same thing (and a whole lot more).

While we continue to investigate what the exact fix should be, can you confirm that upgrading to 439 without upgrading to AD 3.0.0 fixes the problem?

1
  • I did not upgrade Microsoft.Owin.Security.ActiveDirectory, but I did upgrade Microsoft.Owin.Cors and therefore Microsoft.Owin, and I have the problem. Any other packages I should check? I did upgrade the JWT package too.
    – BoB
    Dec 2, 2014 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.