HRESULT: 0x80131040 - Microsoft.WindowsAzure.Storage not found

1

I am currently getting the following error after trying to add a reference to the Azure libraries providing access to storageaccount functionality.

This is the problem I am facing:

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.

I installed the project via NuGet in the project in my solution which works with this code.

I already verified the following:

  • Version of Microsoft.WindowsAzure.Storage in the references tab is 9.3.2.0 - OK
  • packages.config somehow mentions package id="WindowsAzure.Storage" version="9.3.2" targetFramework="net47" />. I find it a bit weird that the Microsoft. is missing in the front. However, this is also done this way in the packages folder where NuGet stored the .dll
  • The corresponding bin/Debug for the project I added this reference to also contains the correct Microsoft.WindowsAzure.Storage.dll

So, I am a little bit lost as to where the problem might be here, as all the versions seem fine to me to be honest.

Any ideas?

EDIT:

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

My references:

enter image description here

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

Additionally I just checked my .csproj, the path here is also correct.

c#
asp.net
azure
nuget
asked on Stack Overflow Feb 11, 2019 by Sossenbinder • edited Feb 12, 2019 by Sossenbinder

1 Answer

0

I finally got it right!

If anyone else is coming here looking for a solution, my problem was the following:

This problem occured in a project inside a solution, while the main project (a WebRole) apparently also had an older version of this dependency.

I setup my build log to log on diagnostic level instead of normal, and in there I found out that 1. my WebRole had that dependency, 2. my WebRole used an older version which clashed with the version given in my project.

I still have no clear idea yet why this interfered but I solved it by clearing the unused reference, and now, it works.

answered on Stack Overflow Feb 13, 2019 by Sossenbinder

User contributions licensed under CC BY-SA 3.0