MCPcopy Create free account
hub / github.com/HangfireIO/Hangfire.Samples / Main

Method Main

Hangfire.WindowsServiceApplication/Program.cs:14–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 private const string Endpoint = "http://localhost:12346";
13
14 static void Main()
15 {
16 // Configure AppDomain parameter to simplify the config – http://stackoverflow.com/a/3501950/1317575
17 AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data"));
18
19 LogProvider.SetCurrentLogProvider(new ColouredConsoleLogProvider());
20
21 HostFactory.Run(x =>
22 {
23 x.Service<Application>(s =>
24 {
25 s.ConstructUsing(name => new Application());
26 s.WhenStarted(tc => tc.Start());
27 s.WhenStopped(tc => tc.Stop());
28 });
29 x.RunAsLocalSystem();
30
31 x.SetDescription("Hangfire Windows Service Sample");
32 x.SetDisplayName("Hangfire Windows Service Sample");
33 x.SetServiceName("hangfire-sample");
34 });
35 }
36
37 private class Application
38 {

Callers

nothing calls this directly

Calls 2

StartMethod · 0.80
StopMethod · 0.80

Tested by

no test coverage detected