Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.4.0 not working when using .netcore 2.2 #840

Closed
Grompie opened this issue Mar 4, 2020 · 3 comments · Fixed by #848
Closed

Version 1.4.0 not working when using .netcore 2.2 #840

Grompie opened this issue Mar 4, 2020 · 3 comments · Fixed by #848
Labels
bug Something isn't working

Comments

@Grompie
Copy link

Grompie commented Mar 4, 2020

Not sure if I misinterpreted this but I was using a .net core 2.2 as host project in combination with a .net standard 2.0 library. Both used version 1.4.0 of the nuget package. I checked all the logs and it seems my project was able to connect to the azure signalr service but the server never received the OnConnectedAsync.

It was only after I made a new project to test out if it was some other code that was bothering me that I found out that it only works if the host project uses .netcore 3.1 (didn't test 3.0).

I switched back to version 1.0.15 on my main project where I want to use signalr service and this seems to have fixed my issues.
Is .netcore 2.2 not "supported" for this library anymore or is something broken? I thought since it's .net standard 2.0 this still should work on .netcore 2.2

@vicancy vicancy added bug Something isn't working and removed bug Something isn't working labels Mar 6, 2020
@vicancy
Copy link
Member

vicancy commented Mar 6, 2020

Quick workaround:

Add to your project a package reference:

<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.0" />

Thanks for reporting the issue! I am able to repro it with netcoreapp2.2.
LTS versions netcoreapp2.1, netcoreapp3.0 and netcoreapp3.1 are working as expected.

netcoerapp2.2 fails with assembly resolving issue:

System.IO.InvalidDataException: Reading map length for 'headers' failed. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Buffers.SequenceReaderExtensions.TryRead[T](SequenceReader1& reader, T& value) at System.Buffers.SequenceReaderExtensions.TryReadReverseEndianness(SequenceReader1& reader, Int16& value)
at MessagePack.MessagePackReader.TryReadMapHeader(Int32& count)
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.ReadMapLength(MessagePackReader& reader, String field)
--- End of inner exception stack trace ---
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.ReadMapLength(MessagePackReader& reader, String field)
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.ReadHeaders(MessagePackReader& reader)
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.CreateOpenConnectionMessage(MessagePackReader& reader, Int32 arrayLength)
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.ParseMessage(MessagePackReader& reader)
at Microsoft.Azure.SignalR.Protocol.ServiceProtocol.TryParseMessage(ReadOnlySequence`1& input, ServiceMessage& message)
at Microsoft.Azure.SignalR.ServiceConnectionBase.ProcessIncomingAsync(ConnectionContext connection)

This issue is introduced in when we removed external dep to MessagePack in #803

To quickly workaround the issue, please add an explicit package reference to the assembly:

<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.0" />

We will investigate to solve the issue from the SDK side and let you updated if there is any progress.

@vicancy
Copy link
Member

vicancy commented Mar 6, 2020

Meanwhile, we need to improve our nightly build to cover the case, going through all the available frameworks. cc @wanlwanl @chenkennt

@wanlwanl
Copy link
Member

wanlwanl commented Mar 6, 2020

Yes, will check and improve the our nightly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants