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