Skip to main content
Participant
November 26, 2014
Question

Issue with .Net >= 4.0 and Console.ReadLine

  • November 26, 2014
  • 2 replies
  • 968 views

I've developed simple C# application which read lines from standard input and writes them to standard output:

   Console.OutputEncoding = System.Text.Encoding.UTF8;

   Console.InputEncoding = System.Text.Encoding.UTF8;

 

   string s = Console.ReadLine();

 

   while (s != "")

   {

        Console.WriteLine(s);

        s = Console.ReadLine();

   }

And I developed desktop Air application which starts NativeProcess of this application and tries to write text data:

process.standardInput.writeUTFBytes(textToSend.text + "\n");

As result Air application has to receive what was sent.

But when C# application is built with .Net 3.5 everything works perfect.

But when C# application is built with .Net 4.0, .Net 4.5 or .Net 4.5.1 then I can't receive in Air application what I've sent. Additionally if I just start Air application with native process and than close it then C# application still be in Task Manager (if C# application was built with .NET >= 4.0). but if I close air application which uses C# application built with .NET 3.5 then application is gone from Task Manager.

Something is really very wrong with C# and reading standard input using .NET >= 4.0.

This topic has been closed for replies.

2 replies

October 24, 2016

Just ran into the same problem, can anyone help?

Participant
November 5, 2015

Did you ever figure this out?