Добавьте пакет Nuget Microsoft.AspNetCore.SignalR.Client и попробуйте следующий код.Я позволил себе использовать ваши данные в вашем посте и перевести их на версию .Net Core.
//I'm not really sure how your HUB route is configured, but this is the usual approach.
var connection = new HubConnectionBuilder()
.WithUrl("https://demohouse.go.ro:96/realTimeNotificationHub") //Make sure that the route is the same with your configured route for your HUB
.Build();
var notificationmessag = new AlertMessage();
notificationmessag.Content = "New message from " + device.Name + " <b>" +
text + " </b>";
notificationmessag.Title = alertType.Name;
connection.StartAsync().ContinueWith(task => {
if (task.IsFaulted)
{
//Do something if the connection failed
}
else
{
//if connection is successfull, do something
connection.InvokeAsync("sendMessage", myData);
}).Wait();
Вы можете использовать другой подход при выполнении асинхронных задач.
Примечание.Хаб должен также использовать пакет .Net Core для SignalR (Microsoft.AspNetCore.SignalR), чтобы это работало (исходя из моего опыта).