How to Run SignalR service as a Server in Xamarin - xamarin

I have a requirement were I need to run SignalR server in Xamarin app, and consume it in web app. As far as I have seen in examples, Xamarin is used as a client consuming the SignalR. Can anyone help me how to register and start SignalR in Xamarin like we do in dotnet core app as below
services.AddSignalR();
app.UseSignalR(routes => {
routes.MapHub<HubName>("path");
});
Is there a way were I can run same/alternative code in Xamarin. Thanks

Your above code, those are used in asp.net core webapp. What I currently know is that you can use SingalR Self-Host to achieve your needs, but it seems that .net core cannot be used, because the official documents are based on .net framework.
Official sample uses the console application, and this article uses windows service.
By using Microsoft.AspNet.SignalR.SelfHost package can achieve your needs.

Related

How to host ms bot created in c# or composer in windows service?

We must use C# MS bot in windows service. How to implement it in .Net core for MSBot SDKv4?
All samples using IIS/Azure App service as hosting platform.
They're aren't any examples or samples that show how to explicitly do this. But you should be able to follow articles such as this or this and then tweak as needed. It shouldn't be much different than hosting any other asp.net core application.
The two points to make sure and cover are:
Make sure that the bot/application is configured (whether in appsettings.json or otherwise) so that it has the right configuration data. Specifically appid/password
Ensure the endpoint can be hit by the connector/channels.

Can I get the projects links via the SonarQube Web Service API

We want to get the project links (Home, Continuous integration,...) via the SonarQube Web Service API.
The links belong to the CoreProperties - https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
Is it possible to read them via the API?
This is not possible yet. But with the UI refactoring that is currently done on 5.2, this is likely that such a WS will be developed.

Parse.com and ASP.Net Cloud code

I am new to Parse.com and used it's iOS SDK successfully to interact with Database at Parse.com as backend.
Now I am looking at creating a simple web service using ASP.Net and C# and want to deploy it to Parse.com Cloud. I googled extensively and not able to find any pointers on this. All the Parse Cloud Code documentation refers to writing Cloud Code using JavaScript.
Do Parse.com cloud supports ASP.Net and C#?
Parse cloud code runs on top of the Node.js Express framework with support for a limited set of npm modules.
You could deploy your ASP.NET web site to a service like Azure websites or another webhost and look at Parse's new webhook tool that lets Parse communicate with your web application.

asp.net web api self hosting / owin / katana

There are multiple question I have around self-hosting
Self Hosting Nuget
There are 2 nuget which provide self hosting : Microsoft.AspNet.WebApi.OwinSelfHost and Microsoft.AspNet.WebApi.SelfHost, so does microsoft have 2 implementation of self hosting?? or they are same??
Owin or Kitana
the name of nuget is Microsoft.AspNet.WebApi.OwinSelfHost has OWIN, but as far as I read Owin is an interface and Kitana an implementation, what is the name of the nuget for implementation??
Hosting in Production
I have managed to run the example by creating a console. But when deploying to prod, how to deploy?? Run the exe and keep running console, cant do that. what if somebody closes that console. So should be hosted as part of windows service?? or Is there any other way?
NuGet package here clearly states this.
Microsoft ASP.NET Web API 2.2 Self Host 5.2.2 This is a legacy package
for hosting ASP.NET Web API within your own process (outside of IIS).
Please use the Microsoft.AspNet.WebApi.OwinSelfHost package for new
projects.
Anyways, SelfHost is old and is based on WCF stack. OwinSelfHost is new and is based on Katana (name is Katana and not Kitana, BTW).
For production hosting, console app is not practical. You will need to create a Windows service. Take a look at this.
after working on months with webapi/owin I got answers to above questions..
The package to use
Microsoft.AspNet.WebApi.OwinSelfHost
and for hosting better to use topshelf
Topshelf
please read this blog post

Chat implementation in windows form using SignalR

I am trying to implement chat application in windows form using SignalR. Actually I had created the web chat application using signalR now i want to synchronize it with windows application.
I am facing following problems
1) How to initialize the hub class as in web application we initialize it in javascript on page load. So how can we innitialize the hub and in web application there is global file to maphub for dynamically generating the signalr javascript so where in windows application can i map the hub to dynamically generate the same.
2) As i want to synchronize the windows application with the web application so do i need to keep both the projects under one solution or can i synchronize the two different solutions??
Please provide the startup code for the first problem as i have searched alot but not getting any way to implement the chat in windows form. the code i found on net just raising errors but helping me in any sense.
This is a full working sample for using SignalR in WinForms and WPF
You can download it and play with it.
There is a WinForms Server and Client which can be your starting point.
It is a good idea to keep the projects under one solution, but its up to you. The WinForms projects will need a server URL where they can communicate with each other (you can see this in the sample code from the above link)

Resources