How do I write a simple--bare minimum needed for it to work--test application that illustrates how to use IPC/Named Pipes?
For example, how would one write a console application where Program 1 says "Hello World" to Program 2 and Program 2 receives message and replies "Roger That" to Program 1.
For someone who is new to IPC and Named Pipes, I found the following NuGet package to be a great help.
GitHub: Named Pipe Wrapper for .NET 4.0
To use first install the package:
Then an example server (copied from the link):
Example client:
Best thing about it for me is that unlike the accepted answer here it supports multiple clients talking to a single server.
FYI dotnet core on linux doesn't support namedpipes, try tcplistener instead if you're on linux
This code has a client round trip a byte.
DotNet Core 2.0 Server ConsoleApp
DotNet Core 2.0 Client ConsoleApp
You can actually write to a named pipe using its name, btw.
Open a command shell as Administrator to get around the default "Access is denied" error: