Highlighted

Issue with .Net >= 4.0 and Console.ReadLine

New Here ,
Nov 26, 2014

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

796

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Issue with .Net >= 4.0 and Console.ReadLine

New Here ,
Nov 26, 2014

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

797

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 26, 2014 0
New Here ,
Nov 04, 2015

Copy link to clipboard

Copied

Did you ever figure this out?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2015 1
denmk LATEST
Community Beginner ,
Oct 24, 2016

Copy link to clipboard

Copied

Just ran into the same problem, can anyone help?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 24, 2016 0