Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Henrik Sunesen 84 posts 281 karma points
    Jun 14, 2020 @ 17:21
    Henrik Sunesen
    0

    Hangfire + Umbraco 8 - Getting dashboard 404 error

    So i've tried to follow: https://cultiv.nl/blog/using-hangfire-for-scheduled-tasks-in-umbraco/

    But i'm getting a 404 when I try to enter the hangfire section in the backoffice. enter image description here

    My files looks like this:

    enter image description here

    I've tryed to add this to my web.config:

    <add key="Umbraco.Core.ReservedPaths" value="/hangfire" />
    

    I hope somebody have a solution to my problem.

  • Peter van den Dungen 66 posts 365 karma points
    Jun 15, 2020 @ 07:17
    Peter van den Dungen
    2

    Hello Henrik,

    Did you also configure your Startup class into the web.config?

    If yes, how does the implementation look like? You have to map a dashboard URL: https://docs.hangfire.io/en/latest/configuration/using-dashboard.html

  • Henrik Sunesen 84 posts 281 karma points
    Jun 15, 2020 @ 17:17
    Henrik Sunesen
    0

    Hi Peter,

    My startup class looks like this:

    public class UmbracoStandardOwinStartup : UmbracoDefaultOwinStartup
    {
        public override void Configuration(IAppBuilder app)
        {
            //ensure the default options are configured
            base.Configuration(app);
    
            // Configure hangfire
            var options = new SqlServerStorageOptions { PrepareSchemaIfNecessary = true };
            const string umbracoConnectionName = Umbraco.Core.Constants.System.UmbracoConnectionName;
            var connectionString = System.Configuration
                .ConfigurationManager
                .ConnectionStrings[umbracoConnectionName]
                .ConnectionString;
    
            GlobalConfiguration.Configuration
                .UseSqlServerStorage(connectionString, options);
    
            // Give hangfire a URL and start the server                
            app.UseHangfireDashboard("/hangfire");
            app.UseHangfireServer();
        }
    }
    
  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jun 15, 2020 @ 07:32
    Bjarne Fyrstenborg
    1

    Hi Henrik

    Did you try with this? Notice the tilde character ~

    <add key="Umbraco.Core.ReservedPaths" value="~/hangfire" />
    

    /Bjarne

  • Henrik Sunesen 84 posts 281 karma points
    Jun 15, 2020 @ 17:16
    Henrik Sunesen
    0

    Hi Bjarne,

    I've tried that but without any luck :)

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jun 16, 2020 @ 06:37
    Bjarne Fyrstenborg
    100

    Hi Henrik

    and you have also changed this in web.config?

    <add key="owin:appStartup" value="UmbracoStandardOwinStartup" />
    

    /Bjarne

  • Henrik Sunesen 84 posts 281 karma points
    Jun 17, 2020 @ 18:17
    Henrik Sunesen
    0

    I have overlooked that :) thank you so much!

Please Sign in or register to post replies

Write your reply to:

Draft