Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Can't use new Signalr 2.1.0 RC1 C# Client with Mono #2232

Closed
ghost opened this issue May 9, 2018 · 7 comments
Closed

Can't use new Signalr 2.1.0 RC1 C# Client with Mono #2232

ghost opened this issue May 9, 2018 · 7 comments
Labels
3 - Done cost: XS Will take about half a day to complete type: Bug
Milestone

Comments

@ghost
Copy link

ghost commented May 9, 2018

I am trying to use signalr 2.1.0-RC1 C# client on Mono (Unity 2018.1 especially). Unity uses Mono equivalent of .NET 4.6 with .NET Standard 2.0 api compatibility. When I call connection.StartAsync() following error occurs:

System.NotImplementedException: The method or operation is not implemented. at System.Net.Http.HttpClientHandler.get_ClientCertificates () [0x00000] in <20a8f293e89843148f03a963627efba4>:0 at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.CreateHttpClient () [0x0005c] in <dd40c651eaf14486a531dbb173fa57e1>:0 at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection..ctor (Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions httpConnectionOptions, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) [0x00080] in <dd40c651eaf14486a531dbb173fa57e1>:0 at Microsoft.AspNetCore.SignalR.Client.HttpConnectionFactory+<ConnectAsync>d__3.MoveNext () [0x00011] in <2d5fd7ae71414f799c1b2fb768dded77>:0 --- End of stack trace from previous location where exception was thrown ---

I guess this is a certificates issue. Can you fix this problem, or make the usage of certificates optional?

Please include as much of the following as you can in your bug report

  • Versions of Server-Side NuGet Packages:
    Microsoft.AspNetCore.SignalR 1.0.0-rc1-final

  • Versions of Client-Side NuGet/NPM Packages:
    Microsoft.AspNetCore.SignalR.Client 1.0.0-rc1-final

  • Are you using the C# client or the JavaScript client:
    C# client

  • The Server you are using (Kestrel/HttpSysServer/IIS/IIS Express/Azure Web App/etc.):
    IIS Express

  • The Operating System on the Server (Windows/Linux/macOS):
    Windows 10 Pro

  • The Operating System on the Client (Windows/Linux/macOS):
    Windows 10 Pro

@davidfowl
Copy link
Member

Wow that's super unfortunate.

I guess this is a certificates issue. Can you fix this problem, or make the usage of certificates optional?

The issue should be fixed in mono. I suggest filing an issue on https://github.com/mono/mono and make sure you're using the latest mono version.

We'll see what we can do in the short term until then, this might just be the tip of the ice berg for issues to be found with mono.

@MiKom
Copy link

MiKom commented May 14, 2018

It seems that the issue here is mono's lacking conformance to netstandard. Does Microsoft keep eye on that somehow? It's unfortunate, that there's this kind of fragmentation already, especially when mono is also supported by Microsoft.

For future internet travellers:
Upstream issue is tracked here: mono/mono#7075

@analogrelay analogrelay added the cost: 0 Will take no time. This is a tracking issue label May 14, 2018
@analogrelay analogrelay added this to the 2.2.0 milestone May 14, 2018
@dasuma
Copy link

dasuma commented May 15, 2018

any solution ?

@ghost
Copy link
Author

ghost commented May 15, 2018

I've temporarily fixed this problem for myself by removing following fragment from Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.cs and rebuilding the library.

if (_httpConnectionOptions.ClientCertificates != null)
{
                    httpClientHandler.ClientCertificates.AddRange(_httpConnectionOptions.ClientCertificates);
}

@dasuma
Copy link

dasuma commented May 15, 2018

yeah this is the solution i remove this line. the steps are

  1. clone from url https://github.com/aspnet/SignalR.git

  2. open the solution with vs2017

  3. go to src/Microsoft.AspNetCore.Http.Connections.Client and file HttpConnection.cs

  4. add coment in line 489 to 492

  //if (_httpConnectionOptions.ClientCertificates != null)
                //{
                //    httpClientHandler.ClientCertificates.AddRange(_httpConnectionOptions.ClientCertificates);
                //}
  1. Build libraries

  2. the later install in your project the xamarin Microsoft.AspNetCore.SignalR.Client

  3. in your folder {projectandoriod}\obj\Debug\android\assets replace the libary Microsoft.AspNetCore.Http.Connections.Client.dll that you built in the step 5

@analogrelay analogrelay modified the milestones: 2.2.0, 2.1.0 May 15, 2018
@analogrelay analogrelay removed the cost: 0 Will take no time. This is a tracking issue label May 15, 2018
@analogrelay
Copy link
Contributor

We've submitted #2270 to fix this issue.

@analogrelay analogrelay added type: Bug cost: XS Will take about half a day to complete SHP: Approval pending and removed SHP: Approval pending labels May 15, 2018
@analogrelay
Copy link
Contributor

This will be fixed in the upcoming release. 2388dd3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - Done cost: XS Will take about half a day to complete type: Bug
Projects
None yet
Development

No branches or pull requests

5 participants