Last active
February 18, 2017 04:11
-
-
Save dilhan2013/4beb69c406b37b8095c66ee901828a1e to your computer and use it in GitHub Desktop.
HangFire SimpleInjector Integration - ASP.NET Web Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: | |
Install HangFire.SimpleInjector NuGet from | |
https://www.nuget.org/packages/Hangfire.SimpleInjector/ | |
Step 2: | |
Add following code block in Global.asax.cs file, | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
var container = new Container(); | |
container.Register<ILogger, AppLogger>(Lifestyle.Singleton); | |
GlobalConfiguration.Configuration.UseActivator(new SimpleInjectorJobActivator(container)); | |
HangfireBootstrapper.Instance.Start(); | |
} | |
Reference: | |
http://docs.hangfire.io/en/latest/background-methods/using-ioc-containers.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment