I want to reset a variable when the stop debugging button is pressed so I'm just wondering, how would I go about detecting when it's pressed
Thanks
If you are writing an extension for VS, you can use IVsDebuggerEvents.OnModeChange which will tell you when the debugger has started/stopped/edit & continue.
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsdebuggerevents.onmodechange.aspx
Related
I am developing an API using c# in .NET Core in Visual Studio Code on a Mac. When I press F5 to debug, I get an alert box with the text Do you want Code to open the external website?. I usually just close this box by pressing escape. This process becomes tedious when you have to rebuild the API many times and every time you have to wait for the alert box just to close it to finish the build.
Any idea how to stop the dialog box from appearing?
Found a solution:
Open launch.json
Remove the serverReadyAction object.
Now the API starts without the alert or tab opening in browser.
I've got iTunes running and the media buttons on my computer work with it. I've installed mmkeys.dll which has been recommended for making iTunes work with media keys in the background and it works fine with all apps - firefox, thunderbird, MSN messenger, Open Office.
But when Visual Studio 2008 is in the foreground the buttons stop working. Can't hit pause when the phone rings.
Any ideas?
This is probably due to Visual Studio running as an Administrator, and whatever software controls your keyboard media buttons OR the media player itself does not run as admin.
As I was answering this question I decided to try opening iTunes as an administrator, and that solved the problem for me.
To make a program always open in admin mode:
Right click the program and select 'Properties'.
Select the 'Compatibility' tab.
Under 'Privilege Level' at the bottom, check check box 'Run this program as an Administrator'.
After you run & close the program for the first time with these settings, make you you tell it that the program worked correctly so that it will keep these settings.
Are you sure that those keys arn't mapped to some action in Visual Studio? A lot of the "media buttons" that I have seen really do key combos so Play might be Ctrl + Alt + P (I don't know any specific key values I'm just recalling the generic pattern I remember). You should be able to check this by going into Visual Studio -> Tools -> Options -> Environment -> Keyboard. Select the "Press Shortcut Keys" text box then hit one of your media buttons. You will see a command become visible in the drop down below this text box showing what command it mapped to that combination.
Intellij is driving me crazy... is there any way I can open the debugs-view (so I can see a list of breakpoints, and edit them) without actually having to launch a program in debug-mode?
If there is a way or button or short-cut, I have failed to see it till now.
After finding my breakpoints thanks to Bohuslav Burghardt, is there a way to mute them all without the debug-pane being visible?
Enable the Favorites tool Window
View -> Tool Windows -> Favorites
Or using keyboard shortcut (Alt + 2)
This will show you the Favorites tool window, which contains your bookmarks and breakpoints.
You can edit breakpoint by right clicking on it and choosing Edit breakpoint.
Update
As for muting all the breakpoints without the debug panel being visible. You have two choices:
Hit CTRL+SHIFT+A and search for Mute breakpoints (invoke this action again to unmute the breakpoints)
Go to Settings/Keymap and bind a keyboard shortcut to the Mute Breakpoints action
It's kind of annoying to have to use my mouse to close the windows that appear when when summoned by my keyboard e.g. I find usages of an object by hitting Shift+F12, or any of the other dockable windows that appear for various other reasons.
Ideally these would close when I hit escape, but this does nothing. Alt+F4 wants to close the entire visual studio.
Is there any keyboard shortcut to close these windows?
To be clear, this is the kind of window I'm referring to:
According to Default Keyboard Shortcuts in Visual Studio 2015, you can use the following:
Shift + Esc - Window.Close (window must have focus)
Ctrl + F4 - Window.CloseDocumentWindow to close the current tab
It appears #inksmithy has answered the question, even though it doesn't work for me. I reckon it's because I'm using ReSharper and he isn't.
For what it's worth, I just discovered Ctrl + Shift + F4 works for me.
I've decided to mark #inksmithy's answer as correct but if that doesn't work for you try my one.
Set Focus to docked window (e.g. [Ctrl]+[g] for immediate window)
Press context menu key (at the right side of the space key)
Press the key to hide that window, indicated by _ in the contextmenu
(depends on your language)
I have a plug-in DLL that is launched from a secondary (not GUI) thread in the main application. The DLL must grab keyboard events from the application's main window. I am using SetWindowsHookEx() and it works great.
However, if I hit a breakpoint in Visual Studio while the hook is active, and then press a key, Visual Studio and my application lock up completely. This is a problem because I usually use the F-keys to step through code. If I use the mouse and step forward from Visual Studio's Debug menu, it works fine. But using F10 et al. is such a habit, I usually forget to use the mouse.
Is there anything I can do to get my keyboard shortcuts back? Or a different method to listen to the keyboard?
That's pretty inevitable, the debugger break stops the hook from handling notifications so the keyboard goes dead. Using the remote debugger on another machine is a good way to debug code like this. You'll also want to increase the hook timeout so Windows doesn't destroy the hook while you are debugging, HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout setting. Assuming you are using WH_KEYBOARD_LL.