private static void Main() { try { var agent = new RollsAgent(); var controller = new RollsController(agent); ServiceRuntime.RegisterServiceAsync("RollsServiceType", context => new RollsServiceEndpoint(context, controller)).GetAwaiter().GetResult(); ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(RollsServiceEndpoint).Name); Thread.Sleep(Timeout.Infinite); } catch (Exception e) { ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString()); throw; } }
public void Initialize() { _sut = new RollsAgent(); }