-
Notifications
You must be signed in to change notification settings - Fork 400
Show .NET Core Server Example #82
Comments
ASP.NET Core SignalR is built on ASP.NET Core. ASP.NET Core is self hostable, not sure what you mean. The old SignalR used Katana (which was OWIN based), it has no self hosting story outside of that. The moral equivalent is what already works today. What exactly are you looking for? |
Thanks @davidfowl, I guess I'm looking for an example that shows setup from a .NET Core Project process self hosting ASP.NET then vs. starting from a ASP.NET Core project. (i.e. how do I set this up from a new VS project done from .NET Core vs. ASP.NET Core). |
Why? |
I'm trying to setup a server/client relationship from a .NET Core process, and I wanted to leverage SignalR's client from multiple languages to connect to the .NET core server. |
You can do that by just making an ASP.NET Core project, I don't understand what you need outside of that. |
I want the server to be a contained exe vs. needing to be served. |
I'm not sure what you mean, you can self host ASP.NET Core applications. |
I guess I don't know much about the differences between how an exe for .NET Core works and how self-hosting an ASP.NET Core application works? |
Ok that makes more sense. ASP.NET Core is basically a console application (unless you’re running in process on IIS). You can get an exe for your ASP.NET Core application |
Thanks @davidfowl, that's good to know. Is there any info on the extra overhead in terms of dependencies/package-size when using an ASP.NET Core application over a .NET Core application? |
Or were you thinking of something like a static site "hosted" using [for example] blobs in a storage account, the HTML of which would just make a connection to a SignalR Hub hosted somewhere (in an EXE, the Azure SignalR Service, whatever), and make use of the SignalR connection as the thing connecting the "website" to the "server?" |
NM, looks like your desires are more like the self-host examples we had for OWIN (which as @davidfowl points out are done using things like |
Is it possible to start a SignalR Core Hub from a console app? It seems like that would be possible according to this thread. My end goal is to setup a hub under a dotnet CLI tool. Is this possible? If there is another place I should ask about this, I will move my question, here just seemed like the most relevant place. EDIT: |
Sure, add a reference to ASP.NET Core and party on. |
I also encountered the same problem, according to this threads, it seems that we can self host the asp .net core project to work around, but i’m not sure whether asp.net core app can call all windows natives APIs, anyone know this? |
Yes you can call native windows APIs when running an ASP.NET Core application on windows. |
That's cool! Thanks for your comments. |
An example showing two .net core console apps communicating with SignalR would be fantastic. |
@devhl-labs - how about an example in which a microservice (a worker-template app) running in Kubernetes, using the .NET SignalR client, and a second client, being a Blazor web assembly client as outlined in this blog post. if that'd suffice, i'll have a demonstration soon of this working. |
Thanks for great examples,
as Service in Startup or hubConnection = new HubConnectionBuilder() in one per controller I'm not sure if it should be one hubConnection, that starts at startup or the only one on the controller or one per Action. And how to use DI to use hubConnection.SendAsync("SendMessage", userInput, messageInput) in the controller / any Action What are the best practices? For example, the Task is : after execute Action in the Controller to send Message to all Client SignalR. |
What type of application is it? Are you hosting SignalR in a different application or in the same application as the API? |
These are 2 applications Server and WebAPI : |
I want to run a SignalR .NET Core server without an ASP.NET website backing it (like the self-host examples of the old SignalR).
It'd be nice to see an example here of how to do this?
The text was updated successfully, but these errors were encountered: