Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'System.Spatial' or one of its dependencies

I get this error message:

Could not load file or assembly 'System.Spatial, Version=5.7.0.0, Culture=neutral, PublicKeyToken=49ba329had364evz' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I tried to uninstall/update System.Spatial and WindowsAzure.Storage Nuget packages but still get the error.

It's a dependency of WindowsAzure.Storage package, but funny thing is that I don't get this error when running my ASP.NET Web API project locally, but only on the Azure server.

I don't know where to find the assembly's manifest, is it packages.config?

How to get rid of this error? I already wasted two days :(

like image 707
Blendester Avatar asked Aug 21 '16 13:08

Blendester


2 Answers

Changed the version details in configuration file based on DLL version present in bin folder of project having issue.

In configuration file it was referring to version 5.6.4 but I have changed to version 5.6.3 which resolved the error.

Before Change

<dependentAssembly>
        <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
      </dependentAssembly>

After change.

<dependentAssembly>
        <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0" />
      </dependentAssembly>
like image 170
Ravi Avatar answered Sep 24 '22 01:09

Ravi


if you are using visual studio, go to nugget package manager and view installed packages, and use update pane to update system.spatial package,

this solved my issue

like image 30
Ali Saleh Avatar answered Sep 26 '22 01:09

Ali Saleh