Exception from loading Microsoft.WindowsAzure.Storage when creating a new HiveConnection

做~自己de王妃 提交于 2019-12-11 20:37:45

问题


I had this code working:

ClusterDetails details

return new HiveConnection(
      new Uri(details.ConnectionUrl),
      details.HttpUserName,
      details.HttpPassword,
      details.DefaultStorageAccount.Name,
      details.DefaultStorageAccount.Key);

but when I updated the dlls through Nuget, I started getting this exception:

{"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"}

Here is my 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>

I've gone through and manually checked all of the dlls in the bin directory to make sure that the versions match. I've also checked to make sure that they all match the latest versions on Nuget.

I've tried adding variations this:

<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>

to the app.config, but it just creates a new exception in a different part of the code.

IHDInsightClient _client;
var details = await _client.CreateClusterAsync(clusterInfo);

This code fails with the following exception:

{"Value cannot be null.\r\nParameter name: provider"}

This happens regardless of which version of the dll I tell it to use. I had v2.2 of the SDK installed outside of this. I uninstalled it, but that did not help.

At this point, I'm out of ideas and falling behind on a deadline because of it. Has anyone run into this before? Does anyone have any ideas on how to fix it?


回答1:


Version 3.1.0.1 of the storage library was released yesterday (I've been dealing with this issue since Sunday). Updating to that fixed the issue.



来源:https://stackoverflow.com/questions/22841556/exception-from-loading-microsoft-windowsazure-storage-when-creating-a-new-hiveco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!