How to disable "Run execution to here" in Visual Studio 15? - visual-studio

How do I disable "Run execution to here" button that appears when moving cursor to the left of the code? It's really annoying when I accidentally click it while selecting code.

Uncheck Show run to click button in editor while debugging at the very end of Debugging options:

A slight difference in Visual Studio 2019

Related

Visual Studio 2010 debugging options missing from toolbar

I haven't had much luck in finding an answer to this, I just switched computers and during debugging I noticed that only 'Step over' appears on the toolbar, there is no 'Step Into' or 'Step out'. Following some advice online I attempted going to Tools ->Customize ->Commands. I confirmed that the buttons are present under the 'Debug' menu bar (Although if I actually go to that Menu I once again only see 'Step over'). Some answers for Visual Studio 2008 said that its possible to drag and drop the commands, I haven't been able to do this either. Any suggestions?
if you right-click on the toolbar and select the option at the bottom which is "customize..."
then go to commands and select the radiobutton for toolbar.
go to the the item "debug" and click the button "Add command"
Good luck!
I was able to resolve this issue by going to Tools -> Import and Export Settings Wizard -> Reset all settings. Then just going through the wizard.

Does a keyboard short cut exist in Visual Studio 2010 to debug the current project?

I have a solution with 36 projects.
When I'm working on one of the projects I'd like to be able to debug it without having to right click the project then select 'debug' then select 'start new instance'.
Thank you.
You could add in the Options dialog under Environment->Keyboard "ClassViewContextMenus.ClassViewProject.Debug.Startnewinstance" as a shortcut.
This starts debugging on the current project.
(maybe this changed a bit for 2010)
source: http://www.sharpdevel.com/2009/09/visual-studio-debug-start-new-instance.html
One thing that you could do is to right click your Solution, go to Properties. Select 'Startup Project' and choose 'Current selection'. After this, the project that you click will be set as startup project. You can debug the project that you want by clicking it and pressing F5 (or whatever key you have for start debugging).
Steps to add keyboard shortcut to debug the present project instead of the solution:
Open VisualStudio2010 > Tools>Options>Environment>Keyboard
Show commands containing "StartNewInstance"
and you will see: "ClassViewContextMenus.ClassViewProject.Debug.StartNewInstance"
Enter your choice into "Press shortcut keys" (for example Alt-F5)
Click the Assign button
OK
Away you go.
In Visual Studio 2017, the keyboard shortcut to start debugging is:
F5

Visual Studio - Attach to process shortcut

When I want to debug I have to do Debug->Attach to Process -> Look for a process in the list -> Attach.
I was wondering if I can create some kind of a shortcut to do this for me?
The shortcut is Ctrl+Alt+P in Visual Studio 2005 and above.
The easiest way to do this is to write a macro which finds the DTE.LocalProcess you wan to target and automatically attach. For example
Public Sub AttachShortcut()
For Each proc In DTE.Debugger.LocalProcesses
If proc.Name = "what you're looking for" Then
proc.Attach()
Exit Sub
End IF
Next
End Sub
Note: This Stack Overflow Question is related and has a sample you may find useful
Attaching to a child process automatically in Visual Studio during Debugging
To enable the 'Attach to Process' toolbar button in Visual Studio 2013, 2015, 2017, 2019, and 2022
Right-click on any toolbar and click 'customize...'
Click the 'commands' tab
Click the 'Toolbar' radio button
Select the toolbar where you want your button to appear from the dropdown
Click the 'Add Command...' button
Select 'Debug' from the categories list on the left
Select 'Attach to Process' from the commands list on the right, and click ok. The button will appear on your selected toolbar.
Optionally, use the 'Move Up' and 'Move Down' buttons on the right to move your new button to your desired location within the toolbar. I keep mine just after the Debug button.
You can use the Alt key shortcut ALT+D,P to launch the "Attach to Process" window via Debug menu.
Once there, you can use your keyboard to search the list of Available Processes (e.g. type "w3wp" if you want to attach to an IIS app pool)
Writing a macro is one option, however it cannot deduct which process to attach to by itself.
Another nice solution is to map the "Attach to process" command to a shortcut key:
(Tools -> Options -> Environment -> Keyboard, type attach, like i did in this example, and select a shortcut key):
This answer should work for Visual Studio 2010.
I like having buttons to do this on my debug toolbar
https://gist.github.com/1406827
The gist contains a method for attaching to IIS (w3wp.exe) or ASP (aspnet_wp.exe) and also nunit (nunit-agent.exe). Instructions are included on how to add the macros to your debug toolbar.
For Visual Studio 2017, 2019, there is a ReAttach extension available. Very handy.
I use this built in "Shortcut"
ALT+D, P, W, ENTER
this opens the debug menu, selects attach to process, scrolls down to w3wp.exe and attaches.
It's long but should work in multiple visual studio versions with no setup required, with or without resharper and it works when running multiple IIS processes as you can choose which process to attach to.
Addins are probably a better way to do this now. I use one called "Attach to anything". You can find them in Visual Studio 2012. Go to "Tools" -> "Extensions and updates", search for "attach", and install "attach to anything".
Also see:
Automate "Attach to Process" in Visual Studio 2012
Alt+Shift+P to reattach the last attached process.
It works for me in Visual Studio 2017.
Personally I prefer to use Debugger.Launch() as suggested here
in this thread, because it doesn't need for references to the DTE (that's IDE-specific and must be explicitly referenced into the project to be used)
VS extensions
Debug Attach Manager
ReAttach
Resurrect
More: Search the VS Marketplace for "attach"
Keyboard
The attach to process shortcut is Ctrl+Alt+P in Visual Studio 2005 and above. You can then press the first letter of the process name you want, e.g. w for w3wp.exe and it'll jump to that, then Enter to attach.
You can use the Alt key shortcut ALT+D,P to launch the "Attach to Process" window via Debug menu.
Code
Add System.Diagnostics.Debugger.Launch() to your code
Current release is VS2015 at time of writing.
Go ahead and edit/extend this answer :-)

Can I disable "debug view" in Visual Studio 2010?

Visual Studio 2010 switches to "debug view" when i click 'start debugging' - much like Eclipse does.
Can i disable this feature - if so how?
My machine doesn't perform very well - therefore the feature is irritating.
Besides with two monitors i don't need it.
Ctrl-F5 starts without debugging.
That's not what I meant, I would like to debug without the "debug view", i.e. without changing the layout of all windows.
You can change the layout of the windows in debug mode, but unfortunately, you cannot turn off the transition from "coding mode" to "debug mode". Your layout is persisted between debugging sessions, though, so any changes you make will remain.
Just click on Debug/Start without debugging from the menu or Ctrl-F5.
Just Press Control-F5

Visual Studio IDE Issue

Can someone tell me why my Ctrl+F5 disappeared in Visual Studio 2008? Its not even in the menu. In the Debug menu, All I have is Windows, Start Debugging, Step Into, Step Over, Exceptions, and Toggle Breakpoints.
I'm using the professional edition of Visual Studio 2008 and for some reason, this morning, it just vanished.
You can re-add it: Tools -> Customize... -> Commands tab -> Select Debug -> Drag the "Start Without Debugging" command to the Debug menu and place it where you want it to be.
As for why it happened, hard to tell.
Was it the button there before becuase I just checked on mine and saw that there was no button with Ctrl+F5, but when you do the command, it works fine.
Right click on the menu bar and click Customize... from there you can add in any options that are missing.
Could this happen if the current "Startup Project" - the one in bold in the Solution Explorer - is not an executable?
(I don't have access to VS to check)

Resources