Multiple web applications on same server

I have multiple websites on the same IIS server. It’s the same application, one for each customer. Each site has it’s own database, which is also used for hangfire.

The startup successfully runs, but not all websites start servers. It appears to be random. One time, Sites 1,4,6, and 7, will have servers. Restart IIS, the next time 2, 3, 6, and 9 will have servers.

No Error occurs on any of them. The code below (with some name changing to protect the innocent) is what each website runs at startup.

GlobalConfiguration.Configuration.UseSqlServerStorage(“MyDBConnection”);

var options = new DashboardOptions();
options.AppPath = VirtualPathUtility.ToAbsolute("~");
options.AuthorizationFilters = new[] { new MyAuth() };

var bkoptions = new BackgroundJobServerOptions();
bkoptions.ServerName = string.Format("{0}.{1}", Environment.MachineName, Guid.NewGuid().ToString());
bkoptions.Queues = new[] { “default” };
bkoptions.WorkerCount = 25;

app.UseHangfireDashboard("/iTasks", options);
app.UseHangfireServer(bkoptions);

var options2 = new DashboardOptions();
options2.AppPath = VirtualPathUtility.ToAbsolute("~");
options2.AuthorizationFilters = new[] { new MyAuth() };

var bkoptions2 = new BackgroundJobServerOptions();
bkoptions2.ServerName = string.Format("{0}.{1}", Environment.MachineName, Guid.NewGuid().ToString());
bkoptions2.Queues = new[] { “ecommerce” };
bkoptions2.WorkerCount = 1;

app.UseHangfireDashboard("/iTasks", options2);
app.UseHangfireServer(bkoptions2);

Anybody have any ideas?

Thanks, Greg