Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with System.Spatial assembly

I recently attempted to run my application locally to test something,but I couldn't due to an assembly issue. Specifically:

Could not load file or assembly 'System.Spatial, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

So, I went poking around here, and found a reference to either manually add things to config files, or uninstall and reinstall things via NuGet. We do not use NuGet to handle anything, so I am wary of changing the application to start doing so. Thus, I began editing config files to try and resolve this issue. I added the following lines, and resolve the unable to load System.Spatial issue:

<dependentAssembly>
    <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.5.0.0" newVersion="5.5.0.0" />
</dependentAssembly>

but now I get this message:

Could not load file or assembly 'Microsoft.Data.Edm' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Maybe the publicKeyToken is inaccurate with the version change? I am not sure what happened to break the assemblies in the first place (since I did not modify the code, and do not use NuGet to update packages for this project), or why the manifest is off.

Can anyone shed some light on what is happening here, how it can be caused, and other possible steps I can take to correct it?

like image 759
Andrew S. Giles Avatar asked Mar 17 '23 13:03

Andrew S. Giles


2 Answers

I resolved this by deleting the contents of the obj folder in the project and rebuilding.

like image 194
Owen Pauling Avatar answered Mar 24 '23 17:03

Owen Pauling


I faced the same issue. Remove the System.Spatial(version 5.6.3) reference and add the System.Spatial(version 5.6.4) will resolve the issue.

like image 41
Jerin Kurian Avatar answered Mar 24 '23 18:03

Jerin Kurian