I\'m studying C# by following the guides in MSDN.
Now, I just tried the Example 1 (here is the link to MSDN), and I\'ve encountered an i
I'm a little bit late to the party, but: in Visual Studio 2019 for .NET Core projects the console doesn't close automatically by default. You can configure the behaviour through menu Tools → Options → Debugging → General → Automatically close the console when debugging stops. If you get your console window automatically closing, check if the mentioned setting is not set.
The same applies to the .NET Framework new style console projects:
Exe
net472
The old style .NET Framework project still unconditionally close the console at the end (as of Visual Studio 16.0.1).
Reference: https://devblogs.microsoft.com/dotnet/net-core-tooling-update-for-visual-studio-2019-preview-2/