Imagesharp: System.Numerics.Vectors - The located assembly's manifest definition does not match the assembly reference.

Created on 10 May 2018  路  6Comments  路  Source: SixLabors/ImageSharp

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have verified that I am running the latest version of ImageSharp
  • [x] I have verified if the problem exist in both DEBUG and RELEASE mode
  • [x] I have searched open and closed issues to ensure it has not already been reported

Description

Trying to execute my Resize method and i get an exception saying:
Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference.

So i tried to download the System.Numerics.Vector v4.1.1 Nuget package and then i get another error saying: Package restore failed. Rolling back changes for 'ProjectName'. However when i download the prerelease v4.5.0-rc1, the package installs but i still get the original error.

EDIT:
Looking deeper into this issue i found the following by setting the output window verbosity to 'diagnostic'.

"System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.

Steps to Reproduce

Create new .Net Core 2 Web Project and got the latest ImageSharp Nuget Package from Nuget Package Manager. Then I copied the code from your documentation .Net Standard 1.3+. My projects is a .Net Core 2 project.
Code i used which produces the error.

    public static void Resize()
        {
            using (Image<Rgba32> image = Image.Load(@"C:\Users\DaniaalNadir\Documents\test/1.jpg"))
            {
                image.Mutate(x => x
                    .Resize(image.Width / 2, image.Height / 2)
                    .Grayscale());
                image.Save(@"C:\Users\DaniaalNadir\Documents\test/1-resized.jpg"); 
            }
        }

System Configuration

Windows 10 x64, Visual Studio 2017 Community.
.Net Core 2 project.
Imagesharp 1.0.0-beta0003

Most helpful comment

@JimBobSquarePants This now works upgraded to SixLabors.ImageSharp 1.0.0-dev001342 and the error no longer shows up. Thanks @iamcarbon for the suggestion and @antoinne85 for the solution.

All 6 comments

Can you try the nightly build to see if this resolves the problem?

@iamcarbon I encountered this error this morning. I updated to 1.0.0-dev001342. It seems to have resolved the issue.

Ah i never got round to @iamcarbon 's fix. Got pulled off to do something else. I will remember this for next time thanks @antoinne85 .

@DaniaalNadir If you are able to confirm @antoinne85 findings that would be great then we can close this off.

Im on it i shall let you know very soon :)

@JimBobSquarePants This now works upgraded to SixLabors.ImageSharp 1.0.0-dev001342 and the error no longer shows up. Thanks @iamcarbon for the suggestion and @antoinne85 for the solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sergio0694 picture Sergio0694  路  3Comments

marcpabst picture marcpabst  路  3Comments

FelixLeChat picture FelixLeChat  路  3Comments

Inumedia picture Inumedia  路  3Comments

jarroda picture jarroda  路  3Comments