DEBUG and RELEASE modeTrying 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.
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");
}
}
Windows 10 x64, Visual Studio 2017 Community.
.Net Core 2 project.
Imagesharp 1.0.0-beta0003
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.
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.