SignalR not calling client methods
<p>So I've read all of the other SO questions with regard to this but it looks like everything should be set up properly. I'm running a self-hosted SignalR console application that has a single empty Hub declaration (this is for one-way communication from the server to connected clients).</p>

<p><strong>EDIT:</strong> Link to project which reproduces the issue - <a href="https://dl.dropboxusercontent.com/u/66477739/SignalRTest.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/66477739/SignalRTest.zip</a></p>

<p>The demo solution has 3 projects:</p>

<ul>
<li>SignalRTest.BusinessLogic - Simple console app that just publishes a message every 10 seconds. These messages are never received by the client. This simulates my business logic layer pushing notifications to connected clients.</li>
<li>SignalRTest.SelfHost - The self-hosted SignalR application + hub. I added a "Send" method to the hub, only to show that everything works when a client calls <code>server.send('message');</code> but it doesn't work when the server initiates the message. <strong>Typing in this console window and hitting enter will send that text to the web app. THIS WORKS!</strong></li>
<li>SignalRTest.UI - Just a blank MVC app with a single page that loads the necessary scripts. A successfully received message would just log console output, there will never be any UI changes on this sample.</li>
</ul>

<p><strong>PublishStatusHub.cs</strong></p>

<pre><code>public class PublishStatusHub : Hub
{
}
</code></pre>

<p><strong>JS</strong></p>

<pre><code>$(document).ready(function () {
    $.connection.hub.url = "http://localhost:8080/signalr";

    var publish = $.connection.publishStatusHub;

    publish.client.addMessage = function (message) {
        console.log(message);
    };

    $.connection.hub.start().done(function() { });
});
</code></pre>

<p><strong>Calling code from a separate assembly</strong></p>

<pre><code>var context = GlobalHost.ConnectionManager.GetHubContext&lt;PublishStatusHub&gt;();
context.Clients.All.addMessage("Starting publish...");
</code></pre>

<p>Although I can see that the above code is executed (via breakpoints), the client method is never called.</p>

<p>I did turn on SignalR logging and no exceptions are being thrown. Also, it's never logging the incoming messages.</p>

<p>Interestingly enough, I can get messages sent to the client through my Main() method in Program.cs within the self-hosted console app:</p>

<p><strong>Program.cs</strong></p>

<pre><code>static void Main(string[] args)
{
    string url = "http://localhost:8080";
    using (WebApp.Start(url))
    {
        Console.WriteLine("Server running on {0}", url);

        while (true)
        {
            string message = Console.ReadLine();

            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext&lt;PublishStatusHub&gt;();
            hubContext.Clients.All.addMessage(message);
        }
    }
}
</code></pre>

<p>Now, if I type in the console window and hit enter, the message is sent successfully to the client and it's logged in the console output window. </p>

<p>HOWEVER, if I move this code to another file within the same console application and then call it from another assembly (which is the end goal), it fails silently again:</p>

<p><strong>MessagePublisher.cs</strong></p>

<pre><code>public class MessagePublisher
{
    public void Publish(string message)
    {
        IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext&lt;PublishStatusHub&gt;();
        hubContext.Clients.All.addMessage(message);
    }
}
</code></pre>

<p><strong>Calling code from a separate assembly</strong></p>

<pre><code>var messagePublisher = new MessagePublisher();
messagePublisher.Publish("Test message");
</code></pre>

<p>I'm stuck on why I can't publish messages to connected clients from external assemblies.</p>