SignalR depenecy injection with EngineContext.Current.Resolve

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I have a separate project added which uses SignalR. When the application first starts up, the code runs fine without any problems, however when the constructor is called again I get the error:

System.ObjectDisposedException: 'Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.'


The constructor for the SignalR is as followed:

public ChatHub()
{
    this._connectionService = EngineContext.Current.Resolve<IConnectionService>();
}


I have registered the service in the Nop.Web.Framework.DependencyRegistrar

builder.RegisterType<ConnectionService>().As<IConnectionService>().InstancePerLifetimeScope();


I can't figure out why when the constructor is called the first time, it works perfectly but the second time it crashes with that error
4 years ago
please look here :
https://www.nopcommerce.com/boards/t/53961/access-to-settingsservice-from-signalr-hub.aspx
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.