Receiving Method not found: 'System.Threading.Tasks.Task`1<Microsoft.Rest.ServiceClientCredentials> Microsoft.Rest.Azure.Authentication.UserTokenProvider.LoginSilentAsync
See original GitHub issueHi 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.GroupableResources
5.<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.GroupableResources
5.GetByResourceGroup(String groupName, String name)
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (15 by maintainers)
Top GitHub Comments
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
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.