protected override void OnExit(ExitEventArgs e) { Log.Info("Windows desktop integration shutting down"); #if !DEBUG Log.Debug("Releasing mutex"); _runOnceMutex.ReleaseMutex(); #endif Log.Debug("Shutting down named pipe server"); _namedPipeServer.Kill(); _namedPipeServer?.Dispose(); base.OnExit(e); }
public ChannelContext Create(NamedPipeServerOptions options) { var impl = new TestServiceImpl(); var server = new NamedPipeServer(_pipeName, options); TestService.BindService(server.ServiceBinder, impl); server.Start(); return(new ChannelContext { Impl = impl, Client = CreateClient(), OnDispose = () => server.Kill() }); }