{"record":{"id":"b2604937e35c4533","repo":"HangfireIO/Hangfire","slug":"app","errorCode":null,"errorMessage":"app","messagePattern":"app","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs","lineNumber":118,"sourceCode":"        /// <summary>\n        /// Maps dashboard to the app builder pipeline at the specified path\n        /// with given authorization filters that apply to any request and\n        /// storage instance that is used to query the information.\n        /// </summary>\n        /// <param name=\"app\">The app builder</param>\n        /// <param name=\"dashboardPath\">The path to map dashboard</param>\n        /// <param name=\"appPath\">The application path on Back To Site link</param>\n        /// <param name=\"authorizationFilters\">Array of authorization filters</param>\n        /// <param name=\"storage\">The storage instance</param>\n        [Obsolete(\"Please use `IAppBuilder.UseHangfireDashboard` OWIN extension method instead. Will be removed in version 2.0.0.\")]\n        public static void MapHangfireDashboard(\n            [NotNull] this IAppBuilder app,\n            string dashboardPath,\n            string appPath,\n            IEnumerable<IAuthorizationFilter> authorizationFilters,\n            JobStorage storage)\n        {\n            if (app == null) throw new ArgumentNullException(nameof(app));\n\n            SignatureConversions.AddConversions(app);\n\n            app.Map(dashboardPath, subApp => subApp.Use<DashboardMiddleware>(\n                appPath,\n                storage,\n                DashboardRoutes.Routes,\n                authorizationFilters));\n        }\n    }\n}\n","sourceCodeStart":100,"sourceCodeEnd":130,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs#L100-L130","documentation":"Thrown as ArgumentNullException by the obsolete MapHangfireDashboard OWIN extension when the 'app' IAppBuilder argument is null. The method is marked [Obsolete] and delegates to the modern UseHangfireDashboard pipeline; passing a null app builder means there is no pipeline to map the dashboard onto.","triggerScenarios":"Calling app.MapHangfireDashboard(...) where 'app' (the 'this IAppBuilder' receiver) is null — e.g. invoking the extension method on a null variable, or calling it as a static method with null as the first argument.","commonSituations":"A Startup.Configuration method that calls MapHangfireDashboard on a field or property that was never assigned; DI/migration code where the IAppBuilder reference is null because the OWIN host wasn't initialized; copy-paste from a sample that assumed a non-null app context.","solutions":["Replace the obsolete MapHangfireDashboard call with the non-obsolete IAppBuilder.UseHangfireDashboard extension, which is the supported API.","Ensure the IAppBuilder instance is the one received in your OWIN Startup.Configuration(IAppBuilder app) method and is non-null.","Verify no conditional code path reassigns the app variable to null before the call."],"exampleFix":"// before\nDashboardOwinExtensions.MapHangfireDashboard(null, \"/hangfire\", \"/\", filters, storage);\n\n// after\napp.UseHangfireDashboard(\"/hangfire\", new DashboardOptions { AuthorizationFilters = filters });","handlingStrategy":"validation","validationCode":"if (app == null) throw new ArgumentNullException(nameof(app));\n// or just use the supported API:\napp.UseHangfireDashboard();","typeGuard":"// _ = app ?? throw new ArgumentNullException(nameof(app));","tryCatchPattern":null,"preventionTips":["Call dashboard wiring from inside Startup.Configuration(IAppBuilder app) where app is guaranteed non-null.","Migrate off the obsolete MapHangfireDashboard to UseHangfireDashboard."],"tags":["argument-null","owin","dashboard","obsolete","configuration"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}