Fluent.Azure上的任何命令都会导致“找不到方法". [英] Any command on Fluent.Azure Results in "Method not found"

查看:62
本文介绍了Fluent.Azure上的任何命令都会导致“找不到方法".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对Fluent.Azure的任何命令都会导致未找到方法".

System.MissingMethodException:找不到方法:'VoidMicrosoft.Rest.TokenCredentials..ctor(Microsoft.Rest.ITokenProvider,System.String,System.String)".

在线查找它,没有这样的构造函数:

它具有以下依赖性:

我的参考文献确实在以下范围内:

解决方案

将Microsoft.Rest.ClientRuntime升级到2.3.21和将Microsoft.Rest.ClientRuntime.Azure.Authentication升级到2.4.1似乎已经解决了myissue.

Any command on Fluent.Azure results in a "Method not found" exception.

System.MissingMethodException: Method not found: 'Void Microsoft.Rest.TokenCredentials..ctor(Microsoft.Rest.ITokenProvider, System.String, System.String)'.

Looking it up online and there isn't a constructor like that: https://docs.microsoft.com/en-us/dotnet/api/microsoft.rest.tokencredentials.-ctor?view=azure-dotnet

I am creating the azure object like so, and it seems to be working.

var azure = Microsoft.Azure.Management.Fluent.Azure
    .Authenticate(credentials)
    .WithDefaultSubscription()
    ;

But as soon as I try either of the following commands, I get this exception:

var l = await azure.VirtualMachines.ListAsync();
    
var webapp = azure.WebApps.GetByResourceGroup(resourceGroup, name);

I'm referencing v. 1.34.0 of Microsoft.Azure.Management.Fluent for .NET 4.7.2.

And it has these dependencies:

And my references do fall within these ranges:

解决方案

Upgrading Microsoft.Rest.ClientRuntime to 2.3.21 and Microsoft.Rest.ClientRuntime.Azure.Authentication to 2.4.1 seems to have resolved myissue.

这篇关于Fluent.Azure上的任何命令都会导致“找不到方法".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆