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.
To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the Properties Pane, go to "Debugging", and in this pane is a line for "Command-line arguments." Add the values you would like to use on this line. They will be passed to the program via the argv array.
Run to a breakpoint in code You can also select the line and then select F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert Breakpoint. The breakpoint appears as a red dot in the left margin next to the line of code. The debugger suspends execution just before the line runs.
i>Attaching</i><i> to the process</i> means telling the CPU to send the instructions in the executable code to a debugger before they're executed by the CPU. In other words, you place the debugger between the executable code and the CPU.
In the Options dialog box, choose Debugging, Symbols, select the Microsoft Symbol Servers check box, and then choose the OK button. The Processes dialog box appears. Select the Show processes from all users check box. In the Available Processes section, choose the process for your service, and then choose Attach.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With