0

I want to be able to within a java application executed outside of visual studio, somehow issue a command to have Visual Studio attach to the applications process ( to debug a DLL ) the dll visual studio built is loaded by the java app.

The Java application has access to it's window title and the process ID.

It would make life much easier if I could within the java app do:

if(debuggingDll) {
     "attachVisualStudioToMyProcess"   // java has access to process ID name of window etc 
}
peterk
  • 5,136
  • 6
  • 33
  • 47
  • Okay, but that's not a question. That's merely a statement. I agree, that would make life easier for you. If you would want to setup something like this you'd need to research how to get the processId/window name of your Java application and you'd need to figure out if Visual Studio has a facility to trigger an external process to attach a debugger. The fact that you had to smear your question-that-is-not-a-question out over two largely unrelated target audiences (Java programmers and expert users of Visual Studio) is a clear sign that this is far too broadly asked. – Gimby Jan 18 '21 at 15:07
  • See https://stackoverflow.com/questions/64396626/automating-attaching-to-multiple-processes-in-visual-studio-2019 – Sergey Vlasov Jan 19 '21 at 06:28
  • The question is given that java has access to the window name and the process id - is there a programmatic api where I can send a rtequest to a running instance of Visu Studio 2015 to "debug->Attach to Process" In other words is there a way to do this? I if someone know or knows it is not possible that would be an answer. I can write the needed code to load a com object or issue a system command or whatever IF Visual Studio has a way to do it. – peterk Jan 19 '21 at 16:22
  • @SergeyVlasov The question is how can I issue a command (or whatever is necessary) to request "Attach To Process" to a running instance of Visual Studio FROM a java application that is not executed by Visual Studio. I of course have the process ID and the Window Name available in the java application. The question you refer to has nothing to do with this. But how one can script inside a Visual Studio extension to attach it to multiple processes. – peterk Jan 19 '21 at 16:28
  • @peterk To call Visual Studio from external app using COM, see https://stackoverflow.com/questions/27356583/getting-envdte-dte-instance-outside-visual-studio-ide – Sergey Vlasov Jan 19 '21 at 17:48
  • @SergeyVlasov thanks I guess I need to find a doc on the api. – peterk Jan 21 '21 at 19:47

0 Answers0