I am using Xamarin Forms project with SignalR, that's hosted on IIS (on a public server).
Same as project in this link.
When I ran this project, it worked correctly, but when I merged this code in my project, it failed on the negotiation function.
Also, I noticed that parameter "connectiondata" is "{[]}" but in a demo, connection data has hub name.
I am using package Microsoft.AspNet.Signalr.Client 2.2.2 in my application.
My application and demo connected on same URL.
Related
I have a Web application that uses the .NET Framework. I created a separate ASP.NET Core web application to use as a SignalR server.
In the .NET Framework web app, I followed the Microsoft tutorial on adding the Javascript client libraries (#microsoft/signalr#latest).
The chat application is working, but then I saw this statement "ASP.NET Core SignalR isn't compatible with clients or servers for ASP.NET SignalR." Link
I get that there is no backwards compatibility, but is this also saying that if your application is using the .NET Framework, you must use ASP.NET SignalR for both client and server?
I found this SO answer which seems to indicate that it is okay, but I'm not sure what he means by "normal System.Web" pipeline.
There is a scenario where we have two applications. One is share point and other obe is Web API.
For security point of view, we need to deploy second stand alone project into the firsy application.
In IIS, I deployed one application. In that folder I deployed another application and make it as web application.
Now everythings runs fine. SharePoint applicantion consume APIs correctly.
Now, I have include signalR to both application where web api application is server and share point is client.
I have global asax file and add startup file for owin signalR. If I add owin automatic startup to false then application runs fine but signalR will not work.
If I start owin then neither api work nor signalR will work.
Important point is when I run SharePoint application from IIS and run web api from visual studio and set path of web api for signalR then it works fine.
What could be the issue?
I'm trying to deploy .net core app with Angular, a project I created from the template available in Visual Studio.
The application I have in IIS is set to run from the angular app
Now within the same application, I added api application which is pointing to the api folder:
While I'm able to access the angular app, when I'm trying to login by calling the controller in the .net core application I'm getting this error:
System.InvalidOperationException: The SPA default page middleware
could not return the default page '/index.html' because it was not
found, and no other middleware handled the request. Your application
is running in Production mode, so make sure it has been published, or
that you have built your SPA manually. Alternatively you may wish to
switch to the Development environment.
Previously, when I was working with angular and .net core I had one project in VS for the .net core app and one project for the angular app and they were running from different subdomains, for example app.mywebsite.com for the angular app and api.mywebsite.com for the .net core app and I didn't have issues.
I was hoping with the .net core / Angular template I'll be able to run both the app and the api from one project but I'm currently experiencing the issues I mentioned above.
I have an existing application running .NET Framework 4.6.1, that uses SignalR version 2.3. The client version I'm using is 2.0, this has a jQuery dependency. This current setup uses SignalR cors as my web front end is on a different domain to my backend services which is where my hubs lie. To be honest it's all working fine and I'm happy with it, even though you could say it's old tech.
This application has been rewritten relatively recently, but at the time the project was started, SignalR on .Net Core didn't exist, or it might have been in alpha so it wasn't considered an option.
I now have the need to add a new project to the solution, a front end dashboard. Where I work, for new development we use angular, and .Net Core. I thought this would be a good opportunity to try to introduce these new techs into the solution. The plan is to have an angular project and use the #aspnet/signalr npm package, I'll be using Typescript.
Now, the problem (if you haven't guessed already). I can't seem to get my new shiny SignalR client to work with my old Framework SignalR server. The error message is very specific when the call to SignalR is made:
Error: Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server.
What are my options here? Am I going to have to upgrade the SignalR project and the projects that interact with SignalR to Core? Or is there something else that I can do I the meantime to give me more time to upgrade?
You have to use the Asp.Net Core Server with Asp.Net Core Client or use Asp.Net SignalR Server with Asp.Net SignalR Client. You cannot mix them, they won't work together.
Not sure of any work around for that. Checking the differences page it does say you can run CORE on .NET Framework 4.6.1 or later .NET Core 2.1 or later. You should still be able run Asp.Net SignalR on a server running .NET Framework 4.6.1 if that is available to you (yes, I know you said you are a angular/core shop).
Short of that... yes, you would need to rewrite your app for SignalR Core (server and client).
What is the best practice to SignalR broadcast from webapi which is located in another project to mvc application when you install signalr package in the mvc application?
MVC - localhost:8080
API - localhost:8080/api (lives in a different project)
Hubs - Shared class library for Hubs
The problem is, if i install signalr package in MVC application, it doesnt work, but if i install it in API application, it then works.
Any ideas?
You don't need hubs to be shared, hubs are necessary (if you use the Hubs API) only to the broadcaster. You can remove their usage from the MVC project.
Moreover, you do not need the full SignalR package in both. The WebAPI will hardly have its own JS clients (they come from the MVC one), so it is enough to install just the SignalR .NET client library. Same reasoning on the MVC project, that is just a client from a SignalR perspective, so you just need to install the SignalR JS package. I'm assuming you are broadcasting from WebAPI project directly towards the MVC users in their browsers, however if you are trying to achieve a server-to-server broadcasting then you'll need the .NET client library there too, but still no need to share hubs.