question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Receiving Method not found: 'System.Threading.Tasks.Task`1<Microsoft.Rest.ServiceClientCredentials> Microsoft.Rest.Azure.Authentication.UserTokenProvider.LoginSilentAsync

See original GitHub issue

Hi I am trying to use the following Code Nuget Version: <package id="Microsoft.Azure.Management.AppService.Fluent" version="1.9.1" targetFramework="net471" /> and all the dependencies.

Code Snippet:

var credentials = SdkContext.AzureCredentialsFactory.FromFile($@“MyAzure.properties”); var azureMgtClient = Azure .Configure() .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic) .Authenticate(credentials) .WithSubscription(_subscriptionId);

Exception occurs here=> var vm = azureMgtClient.VirtualMachines.GetByResourceGroup(“resourceGroup”, “VmName”);

        vm.Start();

I am receiving the exception:

System.MissingMethodException HResult=0x80131513 Message=Method not found: 'System.Threading.Tasks.Task1<Microsoft.Rest.ServiceClientCredentials> Microsoft.Rest.Azure.Authentication.UserTokenProvider.LoginSilentAsync(System.String, System.String, System.String, System.String, Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings, Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache)'. Source=Microsoft.Azure.Management.ResourceManager.Fluent StackTrace: at Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials.<ProcessHttpRequestAsync>d__23.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials.ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesOperations.<GetWithHttpMessagesAsync>d__9.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesOperationsExtensions.<GetAsync>d__4.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Compute.Fluent.VirtualMachinesImpl.<GetInnerByGroupAsync>d__49.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.GroupableResources5.<GetByResourceGroupAsync>d__9.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.Extensions.Synchronize[TResult](Func1 function) at Microsoft.Azure.Management.ResourceManager.Fluent.Core.GroupableResources5.GetByResourceGroup(String groupName, String name)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
qamessengercommented, Apr 23, 2018

HI,

I am using the following Microsoft.Rest.ClientRuntime.Azure.Authentication version 2.3.3 Microsoft.Rest.ClientRuntime version 2.3.11 .Net Framework version for my project is 4.7.1 ADAL the version is 3.19.3

I just downgraded Microsoft.Rest.ClientRuntime.Azure.Authentication version 2.3.3 to 2.3.2 and I no longer get the exception and the VM starts. Looks like the method in question is missing no is not working with the latest version of Fluent 1.9.1 or the other dependent libraries. Greg

2reactions
isaacabrahamcommented, Jul 27, 2018

Confirmed, I’m seeing the same thing here. Downgrading to 2.3.2 fixes the problem for me. Interestingly if you use interactive prompt (device credentials) the issue doesn’t show itself - only if you use fully automated credentials (client id / secret / tenant id) does this issue occur.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method not found: 'System.Threading.Tasks.Task`1< ...
Install Microsoft.Azure.Management.ResourceManager.Fluent->1.24.1 with .net framework 4.6.1 and it will work fine.
Read more >
Azure REST API - authentication error
After creating an App in my account in Azure Active Directory, I create a client ... I receive the token and use it...
Read more >
Azure AD authentication & authorization error codes
This usually occurs when the client application isn't registered in Azure AD or isn't added to the user's Azure AD tenant. The application...
Read more >
Common problems with two-step verification for a work or ...
Your Azure Active Directory (Azure AD) organization can turn on two-step verification ... I'm not receiving the verification code sent to my mobile...
Read more >
Handle errors and exceptions in MSAL.NET
Learn how to handle errors and exceptions, Conditional Access claims challenges, and retries in MSAL.NET.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found