Note that there are some explanatory texts on larger screens.

plurals
  1. POSignalR can't find hub from external assembly
    primarykey
    data
    text
    <p>i writing small web application, and want to use signalr to create push notifications, but when i am loading hubs from other assembly, nothing is happen.</p> <p>here is my assembly locator, from other library which referenced to my asp.net mvc project</p> <pre><code>public class HubAssemblyLocator : IAssemblyLocator { public IList&lt;Assembly&gt; GetAssemblies() { IList&lt;Assembly&gt; allAsms = BuildManager.GetReferencedAssemblies().Cast&lt;Assembly&gt;().ToList(); var executingDirectory = AppDomain.CurrentDomain.BaseDirectory; var assemblyFiles = Directory.EnumerateFiles( executingDirectory, "Application" ); foreach ( var assemblyFile in assemblyFiles.Where( _ =&gt; _.EndsWith( ".dll" ) ) ) { var asm = Assembly.LoadFile( assemblyFile ); if ( asm.GetTypes().Any( _ =&gt; _.BaseType == typeof( Hub ) ) ) { allAsms.Add( asm ); } } return allAsms; } } </code></pre> <p>Here my ApplicationStart Event in Global.asax</p> <pre><code>public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register( GlobalConfiguration.Configuration ); FilterConfig.RegisterGlobalFilters( GlobalFilters.Filters ); RouteConfig.RegisterRoutes( RouteTable.Routes ); InitializeRepositories.Initialize(); var servicesPre = GlobalHost.DependencyResolver.GetServices( typeof( IAssemblyLocator ) ); RouteTable.Routes.MapHubs(new HubConfiguration() { EnableCrossDomain = true}); GlobalHost.DependencyResolver.Register( typeof( IAssemblyLocator ), () =&gt; new HubAssemblyLocator() ); var servicesPost = GlobalHost.DependencyResolver.GetServices(typeof (IAssemblyLocator)); } } </code></pre> <p>in this question this problem resolved, but in my situation is not work.</p> <p><a href="https://stackoverflow.com/questions/17063891/signalr-iassemblylocator-override-not-firing">SignalR IAssemblyLocator not fired</a></p> <p>And in my situation assembly locator not executed.</p> <p>Update: Just register hubs before area and routes registration.</p>
    singulars
    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. 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