Jim_Mcdonalds
Jim_Mcdonalds

Reputation: 496

Dotnet core Web API - read console in debug

I am new to dotnet core.

In Visual Studio, when using debug mode, how can I read the console for messages from Console.WriteLine("Test Message")?

Upvotes: 2

Views: 3894

Answers (2)

Ryan
Ryan

Reputation: 169

The console writes to the output window, the one that starts spitting out lines when the project is building when you hit run.

OK! Finally figured it out, it's System.Diagnostics.Debug.WriteLine(); For asp.net core, from this post Where does Console.WriteLine go in ASP.NET? I made a new project and got my string to show up in the output window using this line.

Upvotes: 0

Neville Nazerane
Neville Nazerane

Reputation: 7019

In visual studio, look for the button you use to debug (green arrow with "IIS Express" written). In front of "IIS Express" you should see a dropdown arrow. Click on the dropdown and select your app name. Now, when you re-run your project on debug, you will find purple console window popup. Your Console.WriteLine should show there.

Upvotes: 3

Related Questions