I am testing an application that uses the COM-Port. The application is running in Virtual PC. I have set up the Virtual PC settings to use the named pipe \.\pipe\mypipe for COM1-Port.
Now I am trying to communicate with this named pipe using C#.
using (var pipe = new NamedPipeServerStream(@"\\.\pipe\mypipe"))
{
pipe.WaitForConnection();
using (var reader = new StreamReader(pipe))
{
// Do some communication here
}
}
The program is waiting at WaitForConnection() although Virtual PC is running and I am trying to communicate with the COM-Port.
I also tried the following, because I am not sure whether I have to create the named pipe in my program or the named pipe is created by Virtual PC.
var p = new NamedPipeClientStream(@"pipe\mypipe");
p.Connect();
What am I doing wrong here?