Took a little digging as Service Fabric dev environment seems to eat exceptions but Hangfire appears to work fine under service fabric once the service endpoints are configured in a way that doesn't blow up in a single server development environment.
If your ServiceManifest.xml has a static port defined like:
<Endpoint Name="ServiceEndpoint" Protocol="http" Port="5080" />
Each instance/node of the service is going to try starting on that port. Since you have a single computer in the SF dev environment this means all nodes are on the same server and sharing the same ports. When a second instance of your Hangfire service tries to start up it will blow up due to an error like:
Microsoft.Net.Http.Server.WebListenerException (0x80004005): The prefix 'http://+:5081/' is already registered.
at Microsoft.Net.Http.Server.UrlGroup.RegisterPrefix(String uriPrefix, Int32 contextId)
at Microsoft.Net.Http.Server.UrlPrefixCollection.RegisterAllPrefixes(UrlGroup urlGroup)
An easy fix for this is to let service fabric automatically determine an available port to access your application by modifying the ServiceManifest like:
<Endpoint Protocol="http" Name="ServiceEndpoint"/>
Also watch out if you are using the ASP Core service fabric integration like:
it'll be very difficult to navigate to the Hangfire dashboard as the URL will need to include the PartitionId/Replica ID. It's easier if you'll be accessing the dash to use ServiceFabricIntegrationOptions.None.