azure-libraries-for-net: Receiving Method not found: 'System.Threading.Tasks.Task`1 Microsoft.Rest.Azure.Authentication.UserTokenProvider.LoginSilentAsync
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)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (15 by maintainers)
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.
I encountered the same problem, updating Microsoft.Rest.ClientRuntime.Azure.Authentication from v2.3.2 to v2.3.3 breaks existing code with:
Just updated
<package id="Microsoft.Azure.Management.Fluent" version="1.13.0" targetFramework="net47" />because of an issue in 1.11, and then wanted to also update other packages.@qamessenger what version of Microsoft.Rest.ClientRuntime.Azure.Authentication do you have downloaded? I had a similar exception happen when I upgraded that to 2.3.3 (after upgrading the Fluent nugets to 1.9.1). I rolled back to 2.3.2 and that seems to work. I have not had time to investigate the exception I saw any further though.