The question of the style of Windsor Castle

I am using hangFire which is a task scheduling library in my project.

I faced the same problem as in this link

However, after replacing LifestylePerWebRequest()

with, HybridPerWebRequestTransient()

I still get the same error message:

HttpContext.Current is null. PerWebRequestLifestyle can only be used in ASP.Net

Here are some lines of my dependency installer:




This is the controller installer in the windsor controller factory

public class ControllersInstaller : IWindsorInstaller
    public void Install(IWindsorContainer container, IConfigurationStore store)


Please let me know if any other information is needed.


source to share

1 answer

See Krzysztof Kozmic's answer here . Your component IApiHra

most likely has a dependency PerWebRequestLifestyle




All Articles