Hi,
I’m trying to have the Hangfire BackgroundJobServer (with a recurring job) run in a Windows Service on a servers, and the dashboard running from a Web app on another server, but the dashboard doesn’t display job names (shows exception: Could not load file or assembly…) probably because the Web app has no idea about the jobs implemented in the Windows Service. After some reading, I came across two solutions for such distributed scenarios:
-
Include the dashboard as an OWIN app in the Windows Service itself (like the sample repo) - I tried it, and the dashboard works, even Basic Authentication works (using Hangfire Dashboard Authorization filter), but I can’t get HTTPS working (so that the the dashboard is accessible as https://localhost:9090 or https://[local-IP]:9090) although IIS has a SSL cert installed.
-
Use an interface in a separate assembly (but common between Web app and Windows Service) and IoC to glue the job definitions in the interface and their implementation in the Windows Service (based on this comment and this one) - I tried it using Hangfire.SimpleInject IoC lib but I couldn’t figure out how to register the implementation class methods (which will be in a different assembly on a separate server).
I’ll appreciate any help or suggestions with either approach to get the dashboard working.