In my case, my hubs are in a project referenced from the project code that spins up the self-hosted application.
On the line connection.Start().Wait();
I get an exception. The following is the sequence of exceptions thrown at that line:
- The specified registry key does not exist System.IO.IOException
- 'MessageHub' Hub could not be resolved InvalidOperationException
- The remote server returned an error: (500) Internal Server Error WebException
The signature of the message hub class in the referenced project is public class MessageHub : Hub
.
Update: To test the theory, I moved the hub class from the referenced project into my test project and updated the namespace. It worked. So I think the theory here is sound... default hub resolution does not find hubs in referenced project or in separate namespace.
How can I convince MapHubs to find the test hub in the referenced project?