Base solution for your next web application

Activities of "pankajmathur"

Question

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)

  • Found 34 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 22 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package Microsoft.Extensions.DependencyModel with version (>= 2.2.0-preview1-26526-03)
  • Found 31 version(s) in aspnetcore-dev [ Nearest version: 2.1.0-preview2-26308-02 ]
  • Found 19 version(s) in nuget.org [ Nearest version: 2.1.0-rc1 ]
  • Found 7 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 1.1.2 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package Microsoft.Win32.Registry with version (>= 4.6.0-preview1-26525-01)
  • Found 40 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 21 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Buffers with version (>= 4.6.0-preview1-26525-01)
  • Found 34 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 11 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.ComponentModel.Annotations with version (>= 4.6.0-preview1-26525-01)
  • Found 34 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 24 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Diagnostics.DiagnosticSource with version (>= 4.6.0-preview1-26525-01)
  • Found 41 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 15 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.1 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.IO.Pipelines with version (>= 4.6.0-preview1-26525-01)
  • Found 32 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 5 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 0 version(s) in Microsoft Visual Studio Offline Packages
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Memory with version (>= 4.6.0-preview1-26525-01)
  • Found 38 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 5 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 0 version(s) in Microsoft Visual Studio Offline Packages
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Numerics.Vectors with version (>= 4.6.0-preview1-26525-01)
  • Found 40 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 19 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Reflection.Metadata with version (>= 1.7.0-preview1-26525-01)
  • Found 33 version(s) in nuget.org [ Nearest version: 1.6.0-rc1 ]
  • Found 31 version(s) in aspnetcore-dev [ Nearest version: 1.6.0-preview2-26308-02 ]
  • Found 4 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 1.4.1 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Runtime.CompilerServices.Unsafe with version (>= 4.6.0-preview1-26525-01)
  • Found 40 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 10 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 1 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Security.Cryptography.Cng with version (>= 4.6.0-preview1-26525-01)
  • Found 34 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 12 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Security.Cryptography.Xml with version (>= 4.6.0-preview1-26525-01)
  • Found 29 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 9 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 0 version(s) in Microsoft Visual Studio Offline Packages
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Security.Principal.Windows with version (>= 4.6.0-preview1-26525-01)
  • Found 40 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 22 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Text.Encodings.Web with version (>= 4.6.0-preview1-26525-01)
  • Found 34 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 14 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 4 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.1 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1 Error NU1102 Unable to find package System.Threading.Tasks.Extensions with version (>= 4.6.0-preview1-26525-01)
  • Found 30 version(s) in aspnetcore-dev [ Nearest version: 4.5.0-preview2-26308-02 ]
  • Found 10 version(s) in nuget.org [ Nearest version: 4.5.0-rc1 ]
  • Found 2 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.3.0 ]
  • Found 0 version(s) in telerik.com CitiXsys.iVend365.Web.Host D:\CXS.Retail\Development\iVend365\src\CitiXsys.iVend365.Web.Host\CitiXsys.iVend365.Web.Host.csproj 1

Please advice...

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>

Question

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&lt;string&gt;("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&lt;string&gt;("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>

&lt;script src=&quot;http://localhost:62114/lib/signalr-client/signalr.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
    debugger;
    var connection = new signalR.HubConnection('http://localhost:62114/signalr', { transport: signalR.TransportType.WebSockets });
    connection.start();
    connection.on("getMessage", function (message) {
        alert(message);
    });
&lt;/script&gt;

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&lt;string&gt;("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

Showing 21 to 30 of 123 entries