I have two projects in my solution:
Project 1: "SignalRChat" (MVC) - Works fine
Project 2: "DatabaseWatcherService" Windows Service - Works fine
I'm trying to make a call to my SignalRChat Hub from my Windows Service and it doesn't appear to be working.
This is where I call my Hub from my windows service (https://github.com/SignalR/SignalR/wiki/Hubs#broadcasting-over-a-hub-from-outside-of-a-hub):
void PerformTimerOperation(object sender, EventArgs e)
{
eventLog1.WriteEntry("Timer ticked...");
var message = "test";
var context = GlobalHost.ConnectionManager.GetHubContext<SignalRChat.ChatHub>();
context.Clients.All.addNewMessageToPage(message);
}
I'm getting the following error when attempting to connect:
Message=The remote server returned an error: (500) Internal Server Error.
I'm trying to connect via var connection = new HubConnection("http://localhost:2129");
Port 2129 is what my MVC project is running on.