-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-attach to service hub process on debug #53601
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current form, this will impact Ctrl+F5 scenarios (start without debugging). There are two changes needed:
- This should only impact F5 scenarios (start debugging)
- This should automatically attach the managed debugger from the current process, as opposed to calling
Debugger.Launch
and forcing the user to complete the process
An example of (2) can be seen in our integration tests.
roslyn/src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstance.cs
Lines 104 to 115 in 075251e
if (System.Diagnostics.Debugger.IsAttached) | |
{ | |
// If a Visual Studio debugger is attached to the test process, attach it to the instance running | |
// integration tests as well. | |
var debuggerHostDte = GetDebuggerHostDte(); | |
var targetProcessId = Process.GetCurrentProcess().Id; | |
var localProcess = debuggerHostDte?.Debugger.LocalProcesses.OfType<EnvDTE80.Process2>().FirstOrDefault(p => p.ProcessID == hostProcess.Id); | |
if (localProcess != null) | |
{ | |
localProcess.Attach2("Managed"); | |
} | |
} |
@sharwell I was also thinking of moving this to a separate profile such as |
This is not possible with service hub today. If we fully owned the process we could do this |
Sure, this would be totally fine. |
I think we just want to set this value in environment we launch VS in.