我有这个代码工作:
ClusterDetails details
return new HiveConnection(
new Uri(details.ConnectionUrl),
details.HttpUserName,
details.HttpPassword,
details.DefaultStorageAccount.Name,
details.DefaultStorageAccount.Key);
但是当我通过 Nuget 更新 dll 时,我开始收到此异常:
{"Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}
这是我的packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Data.Edm" version="5.6.1" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.1" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.1" targetFramework="net45" />
<package id="Microsoft.Hadoop.Client" version="1.1.0.7" targetFramework="net45" />
<package id="Microsoft.Hadoop.Hive" version="0.12.5126.42915" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.1.0.7" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
<package id="System.Spatial" version="5.6.1" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="3.0.3.0" targetFramework="net45" />
</packages>
我已经仔细检查并手动检查了 bin 目录中的所有 dll,以确保版本匹配。我还检查过以确保它们都与 Nuget 上的最新版本匹配。
我尝试添加变体:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.3.0" newVersion="3.0.3.0" />
</dependentAssembly>
到app.config,但它只是在代码的不同部分创建一个新的异常。
IHDInsightClient _client;
var details = await _client.CreateClusterAsync(clusterInfo);
此代码因以下异常而失败:
{"Value cannot be null.\r\nParameter name: provider"}
无论我告诉它使用哪个版本的 dll,都会发生这种情况。我在此之外安装了 v2.2 的 SDK。我卸载了它,但这没有帮助。
此时,我已经没有主意了,因此在最后期限前落后了。以前有人遇到过这个吗?有人对如何修复它有任何想法吗?
最佳答案
昨天发布了存储库的3.1.0.1版本(我从周日开始就一直在处理这个问题)。更新到此解决了问题。
关于c# - 创建新的 HiveConnection 时加载 Microsoft.WindowsAzure.Storage 出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22841556/