I’m building a .Net Core Console App where I use the HostApplicationBuilder so that it will look and feel similar to an ASP NET Core app. This lets me use the built in DI system for most of my services, but for Hangfire I can’t figure out how to get around the old way of registering:
GlobalConfiguration.Configuration .SetDataCompatibilityLevel(CompatibilityLevel.Version_170) .UseColouredConsoleLogProvider() .UseSimpleAssemblyNameTypeSerializer() .UseRecommendedSerializerSettings() .UseSQLiteStorage("hangfire.db") .UseActivator(new ScopedContainerJobActivator(serviceProvider));
Is there any way to register Hangfire in a Console app with the following type of syntax?
services.AddHangfire( configuration => configuration .SetDataCompatibilityLevel( CompatibilityLevel.Version_170 ) .UseSimpleAssemblyNameTypeSerializer() .UseRecommendedSerializerSettings() .UseSQLiteStorage( "hangfire.db", new SQLiteStorageOptions { AutoVacuumSelected = SQLiteStorageOptions.AutoVacuum.FULL } ));