{"record":{"id":"fb83553e12eac94f","repo":"HangfireIO/Hangfire","slug":"app-fb8355","errorCode":null,"errorMessage":"app","messagePattern":"app","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.Core/Obsolete/OwinBootstrapper.cs","lineNumber":40,"sourceCode":"namespace Hangfire\n{\n    /// <exclude />\n    [Obsolete(\"Please use `GlobalConfiguration` class for configuration, or `IAppBuilder.UseHangfireDashboard` and `IAppBuilder.UseHangfireServer` OWIN extension methods instead. Will be removed in version 2.0.0.\")]\n    public static class OwinBootstrapper\n    {\n        /// <summary>\n        /// Bootstraps Hangfire components using the given configuration\n        /// action and maps Hangfire Dashboard to the app builder pipeline\n        /// at the configured path ('/hangfire' by default).\n        /// </summary>\n        /// <param name=\"app\">The app builder</param>\n        /// <param name=\"configurationAction\">Configuration action</param>\n        [Obsolete(\"Please use `GlobalConfiguration` class for configuration, or `IAppBuilder.UseHangfireDashboard` and `IAppBuilder.UseHangfireServer` OWIN extension methods instead. Will be removed in version 2.0.0.\")]\n        public static void UseHangfire(\n            [NotNull] this IAppBuilder app,\n            [NotNull] Action<IBootstrapperConfiguration> configurationAction)\n        {\n            if (app == null) throw new ArgumentNullException(nameof(app));\n            if (configurationAction == null) throw new ArgumentNullException(nameof(configurationAction));\n\n            var configuration = new BootstrapperConfiguration();\n            configurationAction(configuration);\n\n            if (configuration.Activator != null)\n            {\n                JobActivator.Current = configuration.Activator;\n            }\n\n            if (configuration.Storage != null)\n            {\n                JobStorage.Current = configuration.Storage;\n            }\n\n            foreach (var filter in configuration.Filters)\n            {\n                GlobalJobFilters.Filters.Add(filter);","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.Core/Obsolete/OwinBootstrapper.cs#L22-L58","documentation":"Thrown as ArgumentNullException by the obsolete OwinBootstrapper.UseHangfire extension when the 'app' IAppBuilder argument is null. The bootstrapper wires storage, activator, filters, servers, and the dashboard onto the OWIN pipeline; a null app builder means there is no pipeline to extend, so it fails fast at line 40. The whole class is [Obsolete] in favor of GlobalConfiguration plus UseHangfireDashboard/UseHangfireServer.","triggerScenarios":"Calling OwinBootstrapper.UseHangfire(null, configurationAction) — i.e. the 'this IAppBuilder' receiver is null, typically because the Startup.Configuration method received a null app (hosting misconfiguration) or a field was not assigned.","commonSituations":"A Startup class whose Configuration method signature is wrong (so app is null); test code that bootstraps Hangfire without a real OWIN host; migration from OwinBootstrapper to GlobalConfiguration where the app reference was dropped mid-refactor.","solutions":["Replace OwinBootstrapper.UseHangfire with GlobalConfiguration.Configuration.UseXXXStorage(...) plus IAppBuilder.UseHangfireDashboard/UseHangfireServer — the supported, non-obsolete path.","Ensure UseHangfire is called on the non-null IAppBuilder received in Startup.Configuration(IAppBuilder app).","Verify the OWIN host is properly initialized (e.g. WebApp.Start or the ASP.NET Katana host) so app is never null."],"exampleFix":"// before\nOwinBootstrapper.UseHangfire(null, cfg => cfg.UseSqlServerStorage(cs));\n\n// after\nGlobalConfiguration.Configuration.UseSqlServerStorage(cs);\napp.UseHangfireDashboard();\napp.UseHangfireServer();","handlingStrategy":"validation","validationCode":"if (app == null) throw new ArgumentNullException(nameof(app));\n// prefer the supported path:\nGlobalConfiguration.Configuration.UseXXXStorage(cs);\napp.UseHangfireDashboard();\napp.UseHangfireServer();","typeGuard":"// _ = app ?? throw new ArgumentNullException(nameof(app));","tryCatchPattern":null,"preventionTips":["Call configuration from Startup.Configuration(IAppBuilder app) where app is non-null.","Migrate off OwinBootstrapper to GlobalConfiguration + UseHangfireDashboard/UseHangfireServer."],"tags":["argument-null","owin","bootstrapper","obsolete","configuration"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}