簡體   English   中英

HRESULT:0x80131040-找不到Microsoft.WindowsAzure.Storage

[英]HRESULT: 0x80131040 - Microsoft.WindowsAzure.Storage not found

嘗試添加對提供對storageaccount功能的訪問權限的Azure庫的引用后,當前出現以下錯誤。

這是我面臨的問題:

Could not load file or assembly "Microsoft.WindowsAzure.Storage, Version=9.3.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

我通過NuGet在我的解決方案中的項目中安裝了該項目,該項目可以使用此代碼。

我已經驗證了以下內容:

  • “引用”選項卡中的Microsoft.WindowsAzure.Storage版本為9.3.2.0-確定
  • packages.config以某種方式提到了package id="WindowsAzure.Storage" version="9.3.2" targetFramework="net47" /> 我覺得微軟有點奇怪。 在前面不見了。 但是,這也是在NuGet存儲.dll的packages文件夾中以這種方式完成的
  • 我添加了此引用的項目的相應bin / Debug也包含正確的Microsoft.WindowsAzure.Storage.dll

因此,我對問題可能出在哪里有些困惑,老實說,所有版本對我來說似乎都不錯。

有任何想法嗎?

編輯:

這是我的packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.2.0" targetFramework="net47" />
  <package id="JetBrains.Annotations" version="2018.2.1" targetFramework="net47" />
  <package id="Microsoft.AspNet.Mvc" version="5.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.Razor" version="3.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.WebApi" version="5.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.6" targetFramework="net47" />
  <package id="Microsoft.AspNet.WebPages" version="3.2.6" targetFramework="net47" />
  <package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net47" />
  <package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net47" />
  <package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net47" />
  <package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net47" />
  <package id="Microsoft.Owin" version="4.0.0" targetFramework="net47" />
  <package id="Microsoft.Owin.Host.SystemWeb" version="4.0.0" targetFramework="net47" />
  <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net47" />
  <package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net47" />
  <package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net47" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net47" />
  <package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.3" targetFramework="net47" />
  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net47" />
  <package id="Ninject" version="3.3.4" targetFramework="net47" />
  <package id="Owin" version="1.0" targetFramework="net47" />
  <package id="System.Spatial" version="5.6.4" targetFramework="net47" />
  <package id="WindowsAzure.Storage" version="9.3.2" targetFramework="net47" />
</packages>

我的參考資料:

在此處輸入圖片說明

而我的app.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>

另外,我只是檢查了.csproj,這里的路徑也是正確的。

我終於明白了!

如果有人來這里尋求解決方案,我的問題是:

此問題發生在解決方案中的一個項目中,而主項目(WebRole)顯然也具有此依賴項的較舊版本。

我將構建日志設置為登錄診斷級別而不是正常級別,然后在其中發現1.我的WebRole具有該依賴性,2.我的WebRole使用了較舊的版本,該版本與項目中給定的版本沖突。

我仍然不知道為什么這會造成干擾,但是我通過清除未使用的引用來解決它,現在它可以了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM