2

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")?

1
  • side note: I would recommend looking into ILogger. It not only logs into the console but also many other places Commented Jun 18, 2021 at 1:31

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

5 Comments

Its not a Console Application, I am building Web API. Is there a way to read the console?
@Jim_Mcdonalds my mistake, is what you're doing running in a browser? If so you can right click -> inspect and then click "Console"
its a backend server build on dotnet core web api.
@Jim_Mcdonalds okay, gimme a min
@Jim_Mcdonalds do you mean asp.net core?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.