Is it possible to stop Visual Studio auto focus when the debugger hit a breakpoint?
I wasn't able to find any sort of config setting to turn it off but was able to find someone with a workaround; tracepoint.
1. Set your breakpoint at the desired location.
2. Right-click on the red breakpoint dot icon and select “When Hit…”
3. Select “Print a message”.
4. Uncheck “Continue execution”.
You have effectively created a breakpoint that prints out the current function name and thread ID and name and then stops. Tracepoints don’t steal focus like normal breakpoints do.
Credit goes to: http://dpotter.net/technical/2009/09/problem-solved-visual-studio-stealing-focus-when-breakpoint-is-hit/
You can easily disable/enable this behaviour with the Option Settings in Visual Studio 2019:
Tools -> Options -> Debugging -> General -> Bring Visual Studio to the foreground when breaking in the debugger
I have no idea with what Visual Studio Version this feature has been added though.