简体   繁体   中英

Visual Studio 2015: Output from build Window is empty

I'm a super-beginner coder and trying to follow a training video on C# in Visual Studio 2015. The tutorial has me do a new Visual C# project as a Console Application. When I run my code using Ctrl+F5, it launches my code in the console as expected, but the Output --> Show output from build window is completely empty.

I've scoured this site and others for a solution. These are my current VS2015 settings, I've tried changing these with no success:

  • Show Output window when build starts is CHECKED
  • Redirect all Output Window text to the Immediate Window is UNchecked.

This is the code, verbatim what is shown in the tutorial:

using System;

namespace Hello
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World");
        }
    }
}

When the same code is run in the tutorial, the resulting output appears immediately in the Output window:

1>------ Build started: Project: Hello, Configuration: Debug Any CPU ------
1>  Hello -> c:\users\[name]\documents\visual studio 2015\Projects\Hello\Hello\bin\Debug\Hello.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I can see my Output window and I expect to receive this, but I get nothing. First time using Visual Studio, what am I missing?

Prior to adding Console.Read(); at the end of my code, running the code would launch the console with the following output:

Hello, World Press any key to continue...

But, the build output window in VS remained blank as originally described.

After adding Console.Read(); , the output in console no longer contained

Press any key to continue...

However, the build output in VS now displays what is expected as described in Original Post.

If I then remove Console.Read(); , reverting back to my original code, the console output is back to original, and the VS build output window still gives expected output...

I suspect that, using Visual Studio for the first time, it had never been directed to write to the Output window, which was accomplished here with Console.Read(); and should do this going forward...

Link to solution I used:

https://stackoverflow.com/a/5301276/11953574

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM