Repository navigation
Add support for .NET Core 2.1 #459
Description
Activity
- 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.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.
- 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.Memoryfrom nuget
put it in some folder and specify all redirects manually and create entry for previous version:<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Memory" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" /> <codeBase version="4.0.0.0" href="dlls\4.4.0\System.Memory.dll" /> <codeBase version="4.0.1.0" href="System.Memory.dll" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> </dependentAssembly> </assemblyBinding>Reacted by James Jackson-South, Anton Firszov, Leo Choi, Martin, Chriss Barnard and Ondřej DobečkaLooks like we've got a green light to fix this. Here's what we need to do:
- Update the package reference
- adopt a few API changes like
span.DangerousGetPinnableReference()->MemoryMarshal.GetReference(span) - Add
netcoreapp2.1target to the test project - Configure at least one of our CI platforms to also run tests on
2.1
The 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?
Reacted by James Jackson-South@antonfirsov Yeah, let's add it, it should be a quick win.
According to gitter news a PR is actually being prepared for this :)
Reacted by James Jackson-South and Mark EntinghWhat'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.
The nightlies support preview 2 so you should be able to run with the latest there.
I think #577 closes this. 2.1 should work fine in nightlies.
appveyor test execution will be added with .NET Core 2.1 RC2
Description
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:
Steps to Reproduce
use
System.Memory4.5.0-preview2-26202-05and try to load PNG image.System Configuration