You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.txt 1.8 KiB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Please see https://docs.hangfire.io for more information on using Hangfire. The
  2. `Hangfire` meta-package is using SQL Server as a job storage and intended to run
  3. in any OWIN-based web application when targeting full .NET Framework, or ASP.NET
  4. Core web application on .NET Core.
  5. +-----------------------------------------------------------------------------+
  6. | !!! DASHBOARD REQUIRES AUTH CONFIGURATION !!! |
  7. +-----------------------------------------------------------------------------+
  8. By default, ONLY LOCAL requests are allowed to access the Dashboard. Please
  9. see the `Configuring Dashboard authorization` section in Hangfire documentation:
  10. https://docs.hangfire.io/en/latest/configuration/using-dashboard.html#configuring-authorization
  11. Sample ASP.NET Core Startup class
  12. ---------------------------------
  13. using Microsoft.AspNetCore.Builder;
  14. using Microsoft.Extensions.DependencyInjection;
  15. using Hangfire;
  16. namespace MyWebApplication
  17. {
  18. public class Startup
  19. {
  20. public void ConfigureServices(IServiceCollection services)
  21. {
  22. services.AddHangfire(x => x.UseSqlServerStorage("<connection string>"));
  23. services.AddHangfireServer();
  24. }
  25. public void Configure(IApplicationBuilder app)
  26. {
  27. app.UseHangfireDashboard();
  28. }
  29. }
  30. }
  31. Sample OWIN Startup class
  32. -------------------------
  33. using Hangfire;
  34. using Microsoft.Owin;
  35. using Owin;
  36. [assembly: OwinStartup(typeof(MyWebApplication.Startup))]
  37. namespace MyWebApplication
  38. {
  39. public class Startup
  40. {
  41. public void Configuration(IAppBuilder app)
  42. {
  43. GlobalConfiguration.Configuration
  44. .UseSqlServerStorage("<name or connection string>");
  45. app.UseHangfireDashboard();
  46. app.UseHangfireServer();
  47. }
  48. }
  49. }