Krishnan
Krishnan

Reputation: 1

Breakpoint in console App visual studio

I work on a project, where a process starts a console app on another thread and then it continues to its previous flow. I have attached the original process to the debugger, but I can't do that with the console app process, as that process doesn't get listed in the 'Attach to process' list. How can I debug the console app?

Upvotes: 0

Views: 1651

Answers (2)

Tung
Tung

Reputation: 5434

Make sure you check Show processes from all users and Show processes in all sessions

enter image description here

Upvotes: 0

Moo-Juice
Moo-Juice

Reputation: 38825

Not sure why it's not showing in the processes (have you made sure that All processes are showing?).

Anyway, try this:

using System.Diagnostics;

and in your code:

System.Diagnostics.Debugger.Break();

You should then get a dialog when the code hits that line, allowing you to attach Visual Studio to the process.

Upvotes: 3

Related Questions