I am trying to get a dotnet new console sample project (for vscode) to work on Ubuntu 17.10.
I can run the program by default:
using System;
namespace dotnet_console
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello world!");
}
}
}
But when I change it to read input, it becomes really awkward ...
using System;
namespace dotnet_console
{
class Program
{
static void Main(string[] args)
{
Console.Write("Name: ");
var name = Console.ReadLine();
Console.WriteLine("Hello {0}!", name);
}
}
}
The program builds, but does not print Name:. However, if I set breakpoints on lines 1, 2, and 3, I see that the program goes through ALL of them, but doesn't print anything. This is until I stop debugging. Then he prints
Name:
The program '[16322] dotnet-console.dll' exited with code 0 (0x0).
What's going on here? I assume this is vscode because it works as expected when running from the terminal using dotnet run.