Note that there are some explanatory texts on larger screens.

plurals
  1. POSignalR Requests Throwing "Hub could not be resolved."
    primarykey
    data
    text
    <p>I've been using SignalR since an early version and upgraded along the way however I have deployed my application to my Windows Server 2008 R2 production server and now the app crashes out with the " Hub could not be resolved." exception.</p> <p>edit: StackTrace Added:</p> <pre><code>[InvalidOperationException: 'stockitems' Hub could not be resolved.] Microsoft.AspNet.SignalR.Hubs.HubManagerExtensions.EnsureHub(IHubManager hubManager, String hubName, IPerformanceCounter[] counters) +426 Microsoft.AspNet.SignalR.Hubs.HubDispatcher.Initialize(IDependencyResolver resolver, HostContext context) +716 Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment) +1075 Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment) +363 Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute() +68 Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData) +414 [TargetInvocationException: Exception has been thrown by the target of an invocation.] Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result) +146 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +288 </code></pre> <p>On my dev machine and local test server I am getting no issues.</p> <p>The hub in question is really simple:</p> <pre><code> [HubName("StockItems")] public class StockItemHub : Hub { } </code></pre> <p>Originally I thought it was an issue with the HubName so removed it but it still bombs out.</p> <p>Originally I thought it was due to dependency injection so I then changed my Global.asax to look as follows:</p> <pre><code> var signalRResolver = new SignalRDependencyResolver(); GlobalHost.DependencyResolver = signalRResolver; var configuration = new HubConfiguration { Resolver = signalRResolver }; RouteTable.Routes.MapHubs(configuration); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters, config.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); </code></pre> <p>edit: what is SignalRDependencyResolver? SignalRDependencyResolver didn't exist until I tried to solve this issue. As I believe its a dependency injection issue I wrapped DefaultDependencyResolver overrode GetService and GetServices to first check my Ninject kernel for the type and if not fall back to the DefaultDependencyResolver</p> <p>Any ideas?</p> <p>The server is running IIS7, Windows Server 2008 with .Net 4.5 The application is an MVC 4 .Net 4.5</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.
 

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