When I am in the middle of debugging I often find more than one area that can be improved (or fixed) and I like to mark them in such away that I can come back later and make the improvement.
Currently I add a bookmark to the line but this can't include any notes that can be used to remind me why the bookmark was there (you can change the name of the bookmark but this isn't enough). I suppose I really want to be able to add a TODO to the code while the code is running but although Edit and Continue is enabled it is not available in the ASP.NET WebForms (3.5) project.
Are there any Visual Studio features or extensions that will enable this?
Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment.
To bookmark a line of code, place the cursor on the the line of code you intend to bookmark and use the Toggle Bookmark icon in the bookmark window. Another quick way to bookmark code is to use the keyboard shortcut Ctrl+K, Ctrl+K.
Instead of enabling Edit and Continue then entering a TODO:
into the source code, you can create a Task List Shortcut (key cord Ctrl + K, Ctrl + H
).
This adds an entry to the Shortcuts section of the Task List window. From there you can change the description of the task to remind you why you created it.
Due to the fact the answer marked as accepted has been deprecated in VS 2015 onwards, I used this solution instead:
Bookmark a line of code using the key cord Ctrl+K Ctrl+K
, then open the Bookmarks window (Ctrl+K Ctrl+W
). In the Bookmarks window you can rename your bookmarks to whatever you please.
I have tested this in both VS 2015 and 2017 (Community).
IMPORTANT NOTE: Make sure to File->Save All (Ctrl+Shift+S
) every once in a while so you don't lose the bookmarks you've been working on if VS or Windows decide to crash. I have fallen victim to this and it is painful.
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