Hi,
I was updating the ABP nuget to 3.6.2. While updating the ABP, I also updated the latest nuget of all associated nugets. All the projects apart from .Web.Host project all compiles successfully. But .Web.Host throws following compilation error...
The screen shot is also attached.
Severity Code Description Project File Line Suppression State Error NU1102 Unable to find package Microsoft.CSharp with version (>= 4.6.0-preview1-26525-01)
I got the answer.... For the benefit of other people...if you are facing the same issue then please follow this URL....
<a class="postlink" href="https://docs.microsoft.com/en-us/aspnet/core/signalr/publish-to-azure-web-app?view=aspnetcore-2.1">https://docs.microsoft.com/en-us/aspnet ... etcore-2.1</a>
Hi,
My below client code (Console Application) successfully connects to the SignalR while server application runs locally.
var hubConnection = new HubConnectionBuilder()
.WithUrl("http://localhost:62114/signalr")
.Build();
hubConnection.On<string>("getMessage", message => Console.WriteLine(message));
hubConnection.StartAsync().Wait();
Console.WriteLine("Press Enter to Exit ...");
Console.ReadLine();
But if I deploy my server application at azure then my following client (Console application) with the following code, throws "System.Net.WebSockets.WebSocketException. Unable to connect to the remote server" at the line "hubConnection.StartAsync().Wait();"
var hubConnection = new HubConnectionBuilder()
.WithUrl("http://ivend365retail-signalrtest.azurewebsites.net/signalr")
.Build();
hubConnection.On<string>("getMessage", message => Console.WriteLine(message));
hubConnection.StartAsync().Wait();
Console.WriteLine("Press Enter to Exit ...");
Console.ReadLine();
Please advise how to fix this issue...
Regards, Mahendra
Hi Aaron,
Finally I got my mistake...The ABP 3.6.1 is using SignalR Preview1 and My Console App was using signalR RC1 and thats why my console app was not connecting the the server. The moment I took SignalR Preview1 (As suggested by you), it starts connecting the server..
Thanks again for your help....
Regards, Mahendra
Hi Aaron,
If my client application is WEB then it is successfully connect to my SignalR Server. Here is the Code of client
<script src="Scripts/jquery-1.6.4.js"></script> <script src="Scripts/jquery.signalR-2.2.2.js"></script>
<script src="http://localhost:62114/lib/signalr-client/signalr.min.js"></script>
<script>
debugger;
var connection = new signalR.HubConnection('http://localhost:62114/signalr', { transport: signalR.TransportType.WebSockets });
connection.start();
connection.on("getMessage", function (message) {
alert(message);
});
</script>
But if my client application is .Net Core Console application, I am unable to connect. Here is my code. var hubConnection = new HubConnectionBuilder() .WithUrl("http://localhost:62114/signalr", HttpTransportType.WebSockets) .Build();
hubConnection.On<string>("getMessage", (message) => Console.WriteLine(message));
hubConnection.StartAsync().Wait();
The error it says is Unable to connect to the server with any of the available transports...
I am using
What is wrong here? Please advise...
Do you recommend try using Microsoft.AspNetCore.SignalR.Client 1.0.0-preview1-28189
I am using following nuget in Windows App.
Microsoft.AspNet.SignalR.Client 2.2.2
Using your suggestion....I am able to successfully connect my client application with Server Application and also receive the message from server....Thanks for this...
But if my client application is a classic windows desktop application (instead of web application), then I am unable to connect to the server...
See the code below
HubConnection hubConnection; IHubProxy hubProxy;
hubConnection = new HubConnection("http://localhost:62114/signalr"); hubProxy = hubConnection.CreateHubProxy("iVend365Hub"); hubProxy.On<string>("getMessage", (message) => MessageBox.Show(message)); hubConnection.Start().Wait();
In the last line of above code "hubConnection.Start().Wait();", it throws the following error..
System.AggregateException occurred HResult=0x80131500 Message=One or more errors occurred. Source=mscorlib StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at WinFormsApp1.Form1..ctor() in D:\MNJ\R&D\SignalRDemo\WinFormsApp1\Form1.cs:line 25 at WinFormsApp1.Program.Main() in D:\MNJ\R&D\SignalRDemo\WinFormsApp1\Program.cs:line 19
Inner Exception 1: JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 2, position 1.
What am I missing...Please advise..
Regards, Mahendra
I have an application(Let's call it server application) that is built using ABP Framework and has the SignalR implemented. My Startup Class has the following code.
app.UseSignalR(routes => { routes.MapHub<iVend365Hub>("/signalr"); });
I have another WebApplication (Let's call it client application) that is built on normal ASP.Net Core framework and NOT the ABP framework.
Now when my client application needs to connect to my server application via signalR, what would the URL of src attribute of script tag that the client application should inject. I am talking about following script tag that the client application should inject
<script src="<WHAT SHOULD BE THE URL HERE>" type="text/javascript"></script>
I tried browsing the URL <a class="postlink" href="http://localhost:62114/signalr">http://localhost:62114/signalr</a> but it says "Connection ID required"......
Please help
Regards, Mahendra
When I browse <a class="postlink" href="http://localhost:62114/signalr">http://localhost:62114/signalr</a> it gives me the following response... Connection ID required