Reputation: 193
I'm using vsjitdebugger.exe -p {pid}
to attach the visual studio debugger to a running process. It works, but with the annoyance that a popup window prompts me to select a debugger to attach and I can either choose the open instance of visual studio or start a new instance. Is it possible to pass in the .sln file I want it to attach to so that I don't get that prompt? I could choose new instance as the default, but I was hoping I could specify a .sln file so that it would either open that solution or attach to it if it's already open.
Thanks, Greg
Edit:
I was hoping for a programmatic way of doing this. My application is being run by a testing framework and I want it to run without having to click on anything. The help dialog for vsjitdebugger.exe doesn't mention that what I want is possible. What I really want is the ability to do: vsjitdebugger.exe -p {pid} -s 'solution.sln'
and bypass that popup.
Upvotes: 19
Views: 13424
Reputation: 1910
Have a look at this article, although it uses macro's you could convert into C# or vb.net reasonable easy.
http://www.codeproject.com/KB/macros/AttachedProcess.aspx
Upvotes: 1
Reputation: 9021
I am not sure whether the debugger allows the option of loading the solution when you launch it. It is not possible for the debugger to know which solution the executable belongs to as the the only argument being provided is the pid
.
If you want to launch the process and debug it through visual studio solution, then the best way to do this would be to start the process and attach it to the debugger.
More information on how to attach to process is at How to: Attach to a Running Process
Also, have a look at this question: Run Debug mode from command line
Upvotes: 0