Errors occuring when running simple Hello World in Visual Studio 2017
None of that output is an error message. It says your program ran to completion successfully and then exited. The C# compiler does not add a "Press any key to continue..." message after the program completes unlike some C compilers - so after the program runs it disappears leaving no-trace on screen.
Look for your void Main
, int Main
, (or async Task Main
) method and add Console.WriteLine("done!"); Console.ReadLine();
immediately before the closing curly brace }
.
Update for Visual Studio 2019:
Since C# 8.0 in VS2019, the IDE now does run console-mode applications using a special host process that will add the "Press any key to continue..." message after the program has finished running.
These aren't errors, they are just messages, showing that module XY was loaded. They can be very distracting from the debug messages you actually want to see.
If they disturb you (like me!) and you just want to turn off those messages in Visual Studio, there are two ways to do that:
1st Way to disable it
Go to Tools -> Options, type "debugging" into the search box, navigate to the "Output Window" settings and turn "Module Load Messages" Off.
The screenshot below illustrates how find the setting:
2nd Way to disable it
In the Debug Output Window, right-click to bring up the context menu, then un-tick the option as shown below:
Note: I also turned the Thread Exit Messages off - together with the option above it reduces the noise in the output window significantly!