You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently upgrade my system to ASP.NET Core 2.1.0-preview2-30045
This libraries are using System.Memory 4.5.0-preview2-26202-05
After update I'm not able to load image any more: using (var image = Image.Load<Rgba32>(pictureDataBytes, new PngDecoder()))
this is throwing exception:
System.MethodAccessException: Attempt by method 'SixLabors.ImageSharp.Formats.Png.Filters.SubFilter.Decode(System.Span`1<Byte>, Int32)' to access method 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.
at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.DecodePixelData[TPixel](Stream compressedStream, ImageFrame`1 image)
at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.Decode[TPixel](Stream stream)
at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode[TPixel](Configuration configuration, Stream stream)
at SixLabors.ImageSharp.Image.<>c__DisplayClass43_0`1.<Load>b__0(Stream s)
at SixLabors.ImageSharp.Image.WithSeekableStream[T](Stream stream, Func`2 action)
at SixLabors.ImageSharp.Image.Load[TPixel](Stream stream, IImageDecoder decoder)
at SixLabors.ImageSharp.Image.Load[TPixel](Byte[] data, IImageDecoder decoder)
Steps to Reproduce
use System.Memory4.5.0-preview2-26202-05 and try to load PNG image.
System Configuration
ImageSharp version: 1.0.0-beta0002
Other ImageSharp packages and versions: 1.0.0-beta0002
Environment (Operating system, version and so on): Windows 10
changed the title [-]System.MethodAccessException: Attempt by method 'SixLabors.ImageSharp.Formats.Png.Filters.SubFilter.Decode(System.Span`1<Byte>, Int32)' to access method 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/-][+]System.MethodAccessException: 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/+]on Feb 7, 2018
@msmolka the 4.5 version of System.Memory used by .NET Core 2.1 is not yet available on NuGet, thus we are not able to support it in our beta ImageSharp package published on NuGet.
This means that we only support .NET Core <= 2.0 at the moment. I hope 2.1 reaches preview state soon, so we can add support for it.
changed the title [-]System.MethodAccessException: 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/-][+]Add support for .NET Core 2.1[/+]on Feb 7, 2018
Thanks, I understand
I have web core app, which is using this library. I need to add SignalR, which is on preview right now, which then breaks this lib.
Fighting with manual binding redirects and codeBase, a lot of manual work. Had to switch off automatic binding redirects.
Maybe it will finally work. Started looking promising.
Just a comment if somebody will need to work with version 2.1 and ImageSharp
Binding redirects are working in .NET Core (in unit tests as well).
This issue can be workaround by disabling <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
Then get latest 4.4.0System.Memory from nuget
put it in some folder and specify all redirects manually and create entry for previous version:
What's the current status on this? .NET core 2.1 is meanwhile in preview2-final and the release slowly gets onto the horizon. Just searched through the PRs and couldn't find the mentioned one.
Activity
[-]System.MethodAccessException: Attempt by method 'SixLabors.ImageSharp.Formats.Png.Filters.SubFilter.Decode(System.Span`1<Byte>, Int32)' to access method 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/-][+]System.MethodAccessException: 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/+]antonfirsov commentedon Feb 7, 2018
@msmolka the 4.5 version of
System.Memoryused by .NET Core 2.1 is not yet available on NuGet, thus we are not able to support it in our beta ImageSharp package published on NuGet.This means that we only support .NET Core <= 2.0 at the moment. I hope 2.1 reaches preview state soon, so we can add support for it.
[-]System.MethodAccessException: 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.[/-][+]Add support for .NET Core 2.1[/+]msmolka commentedon Feb 7, 2018
Thanks, I understand
I have web core app, which is using this library. I need to add SignalR, which is on preview right now, which then breaks this lib.
Fighting with manual binding redirects and codeBase, a lot of manual work. Had to switch off automatic binding redirects.
Maybe it will finally work. Started looking promising.
msmolka commentedon Feb 8, 2018
Just a comment if somebody will need to work with version 2.1 and ImageSharp
Binding redirects are working in .NET Core (in unit tests as well).
This issue can be workaround by disabling
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>Then get latest
4.4.0System.Memoryfrom nugetput it in some folder and specify all redirects manually and create entry for previous version:
antonfirsov commentedon Feb 27, 2018
Looks like we've got a green light to fix this. Here's what we need to do:
span.DangerousGetPinnableReference()->MemoryMarshal.GetReference(span)netcoreapp2.1target to the test project2.1The last one is not critical, but I'm pretty much into testing everything that's considered to be a feature.
@JimBobSquarePants should we add this to the beta-3 milestone?
JimBobSquarePants commentedon Feb 28, 2018
@antonfirsov Yeah, let's add it, it should be a quick win.
antonfirsov commentedon Feb 28, 2018
According to gitter news a PR is actually being prepared for this :)
pfeigl commentedon May 4, 2018
What's the current status on this? .NET core 2.1 is meanwhile in preview2-final and the release slowly gets onto the horizon. Just searched through the PRs and couldn't find the mentioned one.
JimBobSquarePants commentedon May 4, 2018
The nightlies support preview 2 so you should be able to run with the latest there.
antonfirsov commentedon May 24, 2018
I think #577 closes this. 2.1 should work fine in nightlies.
appveyor test execution will be added with .NET Core 2.1 RC2