也依赖于microsoft.hadoop.client的workerrole中的microsoft.windowsazure.storage存在依赖版本冲突

wqsoz72f  于 2021-06-02  发布在  Hadoop
关注(0)|答案(0)|浏览(463)

这似乎是一个新手的问题,但我已经挖掘和搜索了几个小时,可能需要一些帮助。
我的云服务中有一个worker角色,该角色的依赖关系树如下所示(nuget用于管理microsoft程序集引用,而对我自己的程序集的引用是项目引用):

MyWorkerRole

      Depends on MyStorageLibrary

           Depends on Microsoft.WindowsAzure.Storage v4.3.0.0

      Depends on MyBigDataLibrary

           Depends on Microsoft.Hadoop.Client v1.5.8.0

               Depends on Microsoft.WindowsAzure.Storage v3.0.3.0 or better

           Depends on Microsoft.WindowsAzure.Storage v4.3.0.0 (my code in this library doesn't use it directly - this is pulled in by nuget when adding the reference to the hadoop client)

我还有一个单元测试项目mybigdatalibrary.test,它具有相同的引用结构。
单元测试(实际上更像是集成测试)和worker角色都执行以下操作:使用mystoragelibrary测试一些blob以查看是否需要执行某些操作,然后使用mybigdatalibrary运行配置单元作业,它最终在jobsubmissionclient上调用getjoboutput()(我假设它使用引擎盖下的存储库来访问blob存储中的输出文件)。
我的单元测试运行良好,返回一个流。
当我在本地计算仿真器中运行worker角色时,配置单元作业会运行,但在它完成时,它会尝试返回我得到的结果流:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.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)
File name: 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Server stack trace: 
   at Microsoft.Hadoop.Client.Storage.WabStorageAbstraction.Read(Uri path)
   at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.<GetJobResultFile>d__3d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.<GetJobOutputAsync>d__22.MoveNext()

Exception rethrown at [0]: 
   at Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library.TaskExtensions.WaitForResult[T](Task`1 task, TimeSpan timeout)
   at Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.Library.TaskExtensions.WaitForResult[T](Task`1 task)
   at Microsoft.WindowsAzure.Management.HDInsight.JobSubmission.HDInsightHadoopClient.GetJobOutput(String jobId)
   at MyBigDataLibrary.HDInsight.Hadoop.HiveCommand.ExecuteGetStream() in c:\Development\C#\RetailDataImport.CloudServices\trunk\PremierConcepts.Arch.BigData\HDInsight\Hadoop\HiveCommand.cs:line 61

myworkerrole.dll.config中确实显示以下内容:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldDataVersion="0.0.0.0-4.3.0.0" newDataVersion="4.3.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

我知道单元测试和辅助角色都已成功加载microsoft.windowsazure.storage 4.3.0.0,因为在尝试运行配置单元作业之前,这两个角色都已成功访问存储中的blob,并且我已使用process explorer查看加载的程序集。
我正在部署到一个测试云服务示例,以确定它是否在azure中也有同样的问题,并可以报告结果,但这需要一些时间,我需要在模拟器中解决问题。
提前感谢您的帮助。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题