core icon indicating copy to clipboard operation
core copied to clipboard

Modified Hello world sample shows strange behavior

Open vivekmishra-sft opened this issue 10 years ago • 2 comments

I simply followed the steps given at [https://www.microsoft.com/net/core#windows] after installing dotnet core on Windows 7 sp1 system.

Here is the complete modified program:

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        Console.Write("Enter a number to see magic: ");
        int num = Convert.ToInt32(Console.ReadLine());
        for(int i=0; i <=num; i++)
        {
        Console.WriteLine(i);
        }
        }
    }
}

It compiled correctly and when I run it with "dotnet run" command, it writes "Hello world!" and waits for the user input without showing the message first which is strange behavior.

The same program when i run on .Net 4.5 compiler, gives me the correct result.

vivekmishra-sft avatar May 20 '16 05:05 vivekmishra-sft

@vivekmishra-sft this is strange? Can you please open an issue for this on the dotnet/cli repo and close this one? Thanks!

thesmithee avatar May 21 '16 21:05 thesmithee

@blackdwarf I am closing this issue here and opening the new one as told by you. Thanks

vivekmishra-sft avatar May 23 '16 05:05 vivekmishra-sft