using System.Text; using NamedPipes; var count = 0; var message = "Hello World!".ToCharArray(); while (true) { var pipeClient = new NamedPipeClient("testPipe",@".\","TestServer"); Thread.Sleep(100); pipeClient.SetMessageAsync($"Hello from TestClient " + count++).GetAwaiter().GetResult(); pipeClient.SetDebugObjectAsync(new DebugObject{Type = typeof(string).FullName,Data = Encoding.GetEncoding("UTF-8").GetBytes(message)}).GetAwaiter().GetResult(); pipeClient.Dispose(); }