Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I came across with same issue couple days ago. That took my 2 days to find solution and resolve it. After some serious investigate the problems root cause was the signalr dependency resolver that I set customly. </p> <p>At the end I found <a href="https://github.com/SignalR/SignalR/wiki/Extensibility" rel="noreferrer">this link</a> and that was saying this:</p> <blockquote> <p>Replacing the DependencyResolver</p> <p>You can change the DependencyResolver to use your DI container of choice by setting GlobalHost.DependencyResolver.</p> <p><strong>NOTE: DO NOT override the global resolver in PreApplicationStart, it will not work, or it'll work only sometimes. Do it in PostApplicationStart (using WebActivator) or in Global.asax.</strong></p> </blockquote> <p>The important place here the NOTE. Of course after signalr 2.0 this documentation become <strong>deprecated</strong>. So I mixed some of here with the new SignalR API. In new SignalR API not using WebActivatorEx anymore. OwinStartup preferred instead of WebActivator.</p> <pre><code>[assembly: OwinStartupAttribute(typeof(YourNamespace.Startup))] namespace YourNamespace { public partial class Startup { public void Configuration(IAppBuilder app) { //IoC container registration process UnityConfig.RegisterComponents(); UnityConfig.Container.RegisterType&lt;AHub, AHub&gt;(); HubConfiguration config = new HubConfiguration(); config.EnableJavaScriptProxies = true; //You should remove your dependency resolver code from here to Global.asax Application_Start method. Before setting the MVC properties. //config.Resolver = new SignalrDefaultDependencyResolver(UnityConfig.Container); // your dependency resolver // app.MapSignalR(config); } } } </code></pre> <p>And in your global.asax </p> <pre><code>namespace YourNamespace { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { //Here your SignalR dependency resolver GlobalHost.DependencyResolver = new SignalrDefaultDependencyResolver(UnityConfig.Container); //other settings goes on AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } } } </code></pre> <p>I dont want to send all the code here, for showing up the real problem.</p> <p>So for me everything works fine for now. Dependency injection also works too. But the bad part is everywhere that I searched David Fowler was saying "Its by design". I started to think is this design really a necessary or a mistake.</p> <p>Hope it helps somebody else who makes research for same problem.</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.
    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