Stop debugging one project - visual-studio-2010

I regularly debug several projects contained in one solution using the same Visual Studio instance. For that, I use the "Debug"->"Start new instance" menu on each project I want to debug:
When using the menu "Debug"->"Stop debugging", all projects debug sessions are stopped.
How can I stop the debug session of one project only?

Bring up the Processes window (normally found under Debug -> Windows -> Processes), right click on the process you wish to stop debugging and slect either "Detach Process" (to stop debugging and leave the process running) or "Terminate Process" (to terminate the process)
(This screenshot is of Visual Studio 2012, however the dialog is very similar in previous versions of Visual Studio)

Related

Visual Studio 2017 starts new instance of browser

I installed Visual Studio 2017 and it starts new instance of browser for web applications. I want to start it in the current opened browser, without any new instances (which closes when I stop debugging). Where is this setting?
This is a consequence of a new feature in VS 2017 that allows javascript running in Chrome, to be debugged inside Visual Studio. You can turn the feature off from
Tools > Options > Debugging > General > Enable JavaScript debugging for ASP.NET
The reason this feature requires a new instance of Chrome, is that the debugger connection requires Chrome to be launched with a specific command-line switch that can only be applied at process start, not to currently running processes.
The feature is explained in detail click here.
One other interesting note, is that opening Chrome's developer console, with F12, will have the side-effect of detaching Visual Studio's debugger from the browser.
You can solve this easily.
Go to "Tools" > "Options" > "Projects and Solutions" > "Web Projects"
Uncheck the item "Stop debugger when browser window is closed, close browser when debugging stops" > "Ok"
This should do the needful for you.

VS Debugging: Attach to a process that hasn't startet

In Visual Studio I can attach the debugger to any process that is currently running.
I have an application that is calling my DLLs and what I need is to debug this process from it's beginning. Is this possible?
Open the project properties (context menu, Properties or Alt+Enter)
Go to the Debug tab
Choose "Start external program"
Save and close
Choose debug mode
Run the application (F5)
If the application expects the DLL in a specific path, it may be necessary to add a post build step to copy the DLL to the expected location.

How do you prevent Visual Studio 2012 from closing IE when you stop debugging?

When I was using Visual Studio 2010, I could just "Detach All" and the web site would continue to run and the browser wouldn't close. That would enable me to attach a different solution to debug a separately compiled library. Now all that's left is "Stop Debugging" and "Terminate All".
Although the website is still running in the background, I have to open a new browser window and navigate back where I was.
Is there some way to go back to the 2010 functionality?
Detach All is still available in VS 2012. If you don't have it under Debug in Main Menu then you may need to add it manually (right click on toolbar, select Customize.. from context menu).

Starting multiple projects when debugging in Visual Studio 2010

In Visual Studio 2010, I have a web application and a console application (actually a service using NServiceBus, but it runs locally as a console application) that I want to both startup when I hit Debug.
Right now I have the Web Application set as the startup application and it opens in a browser, then I right click on my Service and go to Debug -> Start new instance. This works fine, but I would rather not do it manually because I sometimes forget and need the Service running to handle messages from the website.
Thanks.
You can start multiple projects by choosing multiple projects to start and the order by right clicking on the solution node on the solution explorer and selecting Properties from the menu. Select the radio button for "Multiple startup projects" and choose the action as Start for the required projects.

Debug multiple copies of a program from one Visual Studio instance

I have a pre-alpha GUI program that I'm dogfooding and want to run under the debugger (for when things go wrong ;), but I don't want to have to launch a new copy of Visual Studio for each instance of the application. Can this be done?
I don't expect to actually be debugging more than one instance at a time, but I still want the debugger in the look for all of them. Also, I'm starting the application a few dozen time a day, so it would have to be easy to do.
You can start an instance of the same, or different projects multiple times in one instance of Visual Studio. Here is how: Right click on any project in Solution Explorer, go to the Debug context menu item, and click Start new instance.
You can view and manipulate all your running processes from the Processes window (menu Debug → Windows → Processes). The menu item (and the Processes window) is only available when the application is running (under Visual Studio).
This can be done.
If you have the Professional version of Visual Studio, you can use it to attach to each instance of the application that you have open.
First, compile the application with debug information so that it can actually be debugged.
Then launch your application. Open as many instances as you need.
In Visual Studio, click menu Debug → Attach to Process.... Select the process(es) you want to debug. You can select more than one from the list by Shift + clicking or Ctrl + clicking them.
I've just tested this to make sure. One instance of Visual Studio (at least Visual Studio 2008) can debug multiple instances of the same application.
If you don't have the Professional version I don't think this can be done. I'm absolutely sure the Express version can not attach to processes. I'm not sure about what "paid" editions can attach to processes though it is possible to do.

Resources