Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think that I have found an answer to this.</p> <p>After doing some digging around the source code it seems that SignalR uses the following method to designate an IAssemblyLocator to locate Hubs.</p> <pre><code> internal static RouteBase MapHubs(this RouteCollection routes, string name, string path, HubConfiguration configuration, Action&lt;IAppBuilder&gt; build) { var locator = new Lazy&lt;IAssemblyLocator&gt;(() =&gt; new BuildManagerAssemblyLocator()); configuration.Resolver.Register(typeof(IAssemblyLocator), () =&gt; locator.Value); InitializeProtectedData(configuration); return routes.MapOwinPath(name, path, map =&gt; { build(map); map.MapHubs(String.Empty, configuration); }); } public class BuildManagerAssemblyLocator : DefaultAssemblyLocator { public override IList&lt;Assembly&gt; GetAssemblies() { return BuildManager.GetReferencedAssemblies().Cast&lt;Assembly&gt;().ToList(); } } public class DefaultAssemblyLocator : IAssemblyLocator { public virtual IList&lt;Assembly&gt; GetAssemblies() { return AppDomain.CurrentDomain.GetAssemblies(); } } </code></pre> <p>This got me to try to simply add my external assembly to current domain because although it was referenced it was not being loaded.</p> <p>So before calling WebApp.Start I call the following line.</p> <pre><code> static void Main(string[] args) { string url = "http://localhost:8080"; // Add this line AppDomain.CurrentDomain.Load(typeof(Core.Chat).Assembly.FullName); using (WebApp.Start&lt;Startup&gt;(url)) { Console.WriteLine("Server running on {0}", url); Console.ReadLine(); } } </code></pre> <p>Where Core.Chat is simply the Hub class I'm using. And then the hubs defined in referenced assembly are loaded.</p> <p>There might be a more straight forward way to go about this but I could not find anything in the documentation. </p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload