SignalR icon indicating copy to clipboard operation
SignalR copied to clipboard

Xamarin support tracking issue

Open davidfowl opened this issue 8 years ago • 114 comments

There's a bunch of work that is planned but that is also required to make SignalR work. There is an issue in System.Memory preventing it from being used in Xamarin applications. This issue is tracking the work that is being done in corefx to remedy the situation.

davidfowl avatar Apr 06 '18 18:04 davidfowl

We also need to determine our plan for MsgPack in Xamarin. If we support it in the initial release, we need to make sure it's configured appropriately to not use Reflection.Emit.

analogrelay avatar Apr 06 '18 19:04 analogrelay

Most of these PRs are closed, are they in a public build or can we get some access to a build that has these fixes to test out? @davidfowl

analogrelay avatar Apr 19 '18 21:04 analogrelay

Is there an actual version that actually works? Trying to get this to work but getting system.memory error all the time.

elusiven avatar Apr 21 '18 15:04 elusiven

/cc @migueldeicaza

davidfowl avatar Apr 21 '18 15:04 davidfowl

I have the same "system.memory" issue on Xamarin Android (.NET Standard) project using AspNetCore.SignalR.Client. Is there any further update on this please? (I can make progress using UWP)

digitalkirkley avatar Apr 24 '18 11:04 digitalkirkley

I found to get Android building, directly reference: system.memory Then to get running, copy over to debug/Android/assets at post build time: system.io.pipelines, system.threading.tasks.extensions, system.buffers, system.runtime.compilerservices.unsafe

digitalkirkley avatar Apr 25 '18 12:04 digitalkirkley

Version="1.0.0-preview2-final" doesn't build for iOS project on VS 2017 15.6.6

Failed to resolve "System.Buffers.IBufferWriter`1" reference from "System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"

FrancoisM avatar Apr 25 '18 19:04 FrancoisM

@mikaelm12 Did you get a chance to look into this yet?

muratg avatar May 04 '18 20:05 muratg

@muratg I'd need access to a build with these fixes

mikaelm12 avatar May 04 '18 20:05 mikaelm12

@mikaelm12 sounds good, punting the verification out of the milestone.

muratg avatar May 04 '18 21:05 muratg

@akoeplinger any more details you can give here?

davidfowl avatar May 06 '18 20:05 davidfowl

With latest VS for mac 15.7 preview, the AOT compilation error goes away. https://stackoverflow.com/questions/49646078/xamrin-ios-aot-compilation-fails-from-mac-but-builds-fine-from-pc/49699385#49699385

However, on iOS, the following error remains even with rc1-final.

Failed to resolve "System.Buffers.IBufferWriter`1" reference from "System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"

FrancoisM avatar May 07 '18 16:05 FrancoisM

We added the System.Memory.dll facade (that's why the AOT error went away) but we haven't added all the types yet. I'll find out where we're tracking that :)

akoeplinger avatar May 07 '18 16:05 akoeplinger

It's an issue on both iOS and Android actually.

FrancoisM avatar May 07 '18 17:05 FrancoisM

The AOT error didn't go away because I upgraded signalr (it was on preview 1), it went away because I upgraded vs 4 mac :-)

FrancoisM avatar May 07 '18 18:05 FrancoisM

BTW, I'm lost. System.Memory 4.0.1.0 is in .Net Core 2.1. So how can it be used by Xamarin anyway?

I wrote a SOF question to get help understanding the assembly resolution going on here. If anyone here thinks he/she can help me here is the link ;-)

FrancoisM avatar May 07 '18 19:05 FrancoisM

Also, if I change the linker behavior to "Don't link" then I get another error:

Could not AOT the assembly '/Users/francois/Library/Caches/Xamarin/mtbs/builds/AotTests.iOS/678ab06afbe35836bdafdf91a7d48f1c/obj/iPhone/Debug/mtouch-cache/Build/System.IO.Pipelines.dll'

This is strange because I thought the aot errors where caused by the new way of referencing packages and that it was solved with VS 15.7 (and indeed the previous aot error I raised was solved), as explained here.

FrancoisM avatar May 08 '18 07:05 FrancoisM

System.Memory 4.0.1.0 is not support on mono framework 5.10 which is in 15.7. Ref https://releases.xamarin.com/release-15-7/

Supported mono version will be 5.12 or above. which are not release yet. Ref https://www.mono-project.com/docs/about-mono/releases/ Ref https://github.com/xamarin/xamarin-android/pull/1509

AwsomeCode avatar May 08 '18 08:05 AwsomeCode

But why do you use version 4.0.1.0 which is in net core and not in mono when maybe you could use 4.5.0 which (I think) is net standard and already referenced as a nuget package?

FrancoisM avatar May 08 '18 09:05 FrancoisM

Morover, if somewhere you use version 4.0.1.0, why isnt there a #if NETCOREAPP2_1 to prevent it from being compiled in the net standard version consummed by xamarin?

FrancoisM avatar May 08 '18 10:05 FrancoisM