Is it still possible to self-host a SignalR Hub (server) without using IIS / Kestrel?
MS does not have any information as though if it is still possible (using asp.net core migration) to achieve this.
My use case for this would be to be able to deploy both the client and the server to local machines and then be able to easily switch to remote servers at a later stage. Ideally, the client would host the server for now.
ASP.NET Core implies using Kestrel as its web server. That means that in order to host a SignalR hub (server), you will need to use Kestrel and basically build an ASP.NET Core application.
You will however not need to use IIS or some other web server to host the application. Kestrel on its own already is a full web server, so you can use it directly without needing anything else.
The ASP.NET Core application hosting your SignalR hub also doesn’t need to do any other web-stuff. It would be totally fine for it to just contain the single hub and host just that. So you usually don’t need to worry about it too much.
So, to address your use case: Yes, you could have a separate ASP.NET Core application hosting the hub and start that directly on the client and the client could connect to it. And then later you could have another ASP.NET Core application hosting the hub running elsewhere and reconfigure the client to use that one then.
Yes, you can self host .NET Core SignalR.
A SignalR server is usually hosted in an ASP.NET application in IIS, but it can also be self-hosted (such as in a console application or Windows service) using the self-host library.
You can read more about it here.
Related
I am learning about Blazor server apps. We have an existing asp.net MVC application that communicates with a WCF service via netTcpBindings. We are now thinking about moving our development into .net Core so based on that Blazor Server seems very cool to start with.
My question is, how can I consume the existing WCF netTcpBindings service on any new Blazor Server application? I have tried googling this but could not find much on the subject. Is it even possible to consume a WCF service in .Net core (because from what it seems WCF is not brought into .Net core)?
It is still possible to consume WCF from a .Net Core application. Bear in mind that it is nothing else than a communication protocol, so it doesn't really matter what "language" you are using as long as you are able to connect to the server providing the service and you implement the protocol.
Luckily the Microsoft people have that in .Net Core so
Say you have the following service:
on your Server on the Startup.cs file you can then do something like this:
Done, you may now invoke your WCF service from your .Net Core server
After my research SignalR is a middleware I can use in ASP. Is it possible to host the server part in for example a console application or a dll?
I've read about SignalR webhost, but the guide is for .Net Framework: https://learn.microsoft.com/de-de/aspnet/signalr/overview/deployment/tutorial-signalr-self-host
Not 100% sure what you are asking.
SignalR is built into ASP.NET core, you can reference and use it within the same application, which can be running in IIS, or self hosted, even asp.net core web apps are basically console apps, but there will need to be a web (internet aspect to your application.
There are also specific Azure services to handle signal R if that helps
https://azure.microsoft.com/en-gb/services/signalr-service/
I am still relatively new to writing API's and web services, so bear with me if I use incorrect terminology.
I want to know if it is possible to create an API in C# using nancyfx (or any other framework) or even just a simple web app and then set it up as a continually running web service using WampServer. I'm pretty new to Wamp, all I have done so far is create a few rudimentary pages with php; but I can't seem to find any information about running a web service with Wamp using a different back end language other than php.
WAMP is stand for Windows Apache MySQL PHP. As I can say, you can't run a C# web service with it base configuration. However, you actually don't need this. If you are on .net Core, there is a Kestrel web server. You can use it to serve your app. On a .net framework you have a HttpListener which can help you to implement self-hosted web service (for example, a windows service which hosts your application).
There are many other options, btw. Try google for some kind of "Hosting .net web application" or "Self-hosted .net web application"
I made a web application with the following architecture :
A React.js frontend (only client-side javascript, no Node.js server)
A SignalR self-hosted backend in a C# console app
I would like to deploy my setup to Azure but I am a complete newbie with Azure.
I should be fine deploying the front-end by following a tutorial like this one
but I can't find any resource about deploying a SignalR self-hosted backend.
I found some resources discussing about a ASP.NET MVC SignalR web application hosted in IIS on Azure, but not about a self-hosted one.
Should I be using an App Service for my backend? Any caveats?
Thank you for enlighting me
You can but it is not best performance wise, to host your SignlarR on IIS.
Reasons for not hosting in IIS include:
Environments where IIS is not available or desirable, such as an
existing server farm without IIS. The performance overhead of IIS
needs to be avoided. SignalR functionality is to be added to an
exising application that runs in a Windows Service, Azure worker role,
or other process.
In Azure you can run it as for example:
App Service (read more).
Windows Service (example and read more).
Worker role (read more)
We have a web application developed in MVC 4 using Razor (.Net framework 4) and we have another web application developed using .net framework 2.0 without MVC.
We are sharing form authentication using machine key and we are sharing sessions between both application by changing the application name in global.asax.
When we run our project in local environment and in local IIS aswell both of them is working normally and all the multiple requests are processed and completed as usual.
But when we publish our project in IIS hosting server form authentication, session sharing and everything is working normally for a while but after sending multiple requests the MVC doesnot seem to process the request and its blocked so we are not able to send new requests.
Can any one please help us resolve this issue and explain where actually the problem is arising?
Thank you