Unable to use SignalR HubConnectionBuilder.WithUrl and HttpConnectionOptions in Core 3.0
See original GitHub issueUsing latest Core 3.0
I’m trying:
hubConnection = new HubConnectionBuilder().WithUrl("http://localhost:5000/hubs/agenthub", options => options.Cookies.Add(myCookie)).Build();
I get:
Error CS0012 The type 'HttpTransportType' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNetCore.Http.Connections.Common, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. VoyAdminAgent
If I try to install package Microsoft.AspNetCore.Http.Connections.Common
, the latest nuget version is 1.1.0 and I then get:
Error CS1705 Assembly 'Microsoft.AspNetCore.SignalR.Client' with identity 'Microsoft.AspNetCore.SignalR.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' uses 'Microsoft.AspNetCore.Http.Connections.Common, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.AspNetCore.Http.Connections.Common' with identity 'Microsoft.AspNetCore.Http.Connections.Common, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Any help ?
PM> get-package
Microsoft.EntityFrameworkCore {3.0.0-preview.18572.1} VoyAdminAgent
Microsoft.EntityFrameworkCore.Sq... {3.0.0-preview.18572.1} VoyAdminAgent
Microsoft.AspNetCore.SignalR.Client {3.0.0-preview-18579-0056} VoyAdminAgent
Microsoft.NETCore.App {3.0.0-preview-27122-01} VoyAdminAgent
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
I’m guessing you’re referencing nuget package “Microsoft.AspNetCore.SignalR.Client.Core” instead of “Microsoft.AspNetCore.SignalR.Client”
I see. I moved on and chose another way, so I can’t provide a sample app. Thanks anyway.