System.Spatial assembly issue

I recently tried to run my app locally to test something, but I couldn't because of a build issue. In particular:

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 here and found a link to manually add things to config files, or remove and reinstall things via NuGet. We are not using NuGet to process anything, so I am afraid to change the application to start doing this. So I started editing config files to try and fix this issue. I added the following lines and resolved the inability to load the System.Spial 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 installed assembly manifest definition does not map the assembly reference. (Exception from HRESULT: 0x80131040)

Maybe publicKeyToken is inaccurate with version change? I'm not sure what happened to break the assemblies in the first place (since I didn't change the code or use NuGet to update packages for this project), or why the manifest is disabled.

Can anyone shed some light on what is going on here, how this might be caused, and other possible steps I can take to fix this?

+3


source to share


6 answers


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



+2


source


I think you are using a manually installed shared library (using gac-util), if you can include that library by clicking Links-> Add Link-> Browse, then go to that location C: \ Windows \ Microsoft.NET \ assembly \ GAC_32 \ yourlibrary Anyway, you might want to avoid modifying .config files unless you know what you are doing.



+1


source


The minimum required packages for an MVC 4 project should be around 20. If you have a lot of unused links, for example, the System.Spatial link is more than likely, just do the following:

  • Open packages.config file to view all packages
  • Keep a copy of the original package package.config for reference
  • Open Package Manager Console
  • Run in PM> Uninstall-Package System.Spatial
  • Build and run or deploy to verify the issue is gone. If the link is really needed, it won't be created.
  • If the project is not built without reference, PM> Install-Package System.Spatial -Version [version] (using the version number from the copy of the .config package)

Nuget is good for managing legitimate package updates, but it's a pain when many unused packages get installed and one dependency in the latest MVC or .NET will inject you into a DLL addon.

+1


source


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

+1


source


None of this worked for me. After a day spent working on this problem, the solution for me was just the following two steps:

  • open the package manager console window
  • enter PM> Install-Package WindowsAzure.Storage -Version [your_version_number]-preview -Pre

it is supposed to automatically match all dependencies to your current azure version .

+1


source


I removed the link in my project because it was not being used. This fixed it for me.

+1


source







All Articles