Question: Have C# Console application which read/writes on standard input and output. 

```
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Console application");

        while(true)
        {
            int input = Console.Read();

            Console.WriteLine(input.ToString());
        }
    }
}

```

I have other native application which launch above console application and read/writes with help of pipe communication.
C# console application writes are read successfully in external application and also initial writes from external application works fine and then it loops to read from the C# console application.
After that writes from external application on the pipe doesn't work.

Absurd thing is problem is happening on some of the operating system and few it is working fine.

C# Console application compile with .NET Framework 4 / Client Profile.

Answer: 
Known issue from MS :
<http://support.microsoft.com/en-us/kb/2675468>

Please check the KB for more details along with sample provided.
Try

```
static void Main(string[] args)
{
    Console.SetIn(new StreamReader(Console.OpenStandardInput()));
    while (Console.In.Peek() != -1)
    {
        string input = Console.In.ReadLine();
        Console.WriteLine(input);
    }
}

```

Does it work that way?

EDIT: I have updated my answer.

Sample usage/output:

```
dir /B | ConsoleApplication1.exe

```

produces:

```
ConsoleApplication1.exe
ConsoleApplication1.exe.config
ConsoleApplication1.pdb
ConsoleApplication1.vshost.exe
ConsoleApplication1.vshost.exe.config
ConsoleApplication1.vshost.exe.manifest

```

When I try your original code, it ends up spamming -1 constantly.
You can also try:

```
while (true)
{
    int input = Console.Read();
    if (input != -1) { // -1 = no input
        Console.WriteLine(input.ToString());
    }
}

```

Now it handles every character separately.