33

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?

Keith K
  • 2,893
  • 4
  • 33
  • 43

3 Answers3

19

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.

Keith K
  • 2,893
  • 4
  • 33
  • 43
  • 1
    How can I change the description? I tried double click, F2 (trying to rename), right click and search for a rename entry in the menu... No luck with any of those. – slashCoder Jun 28 '16 at 15:34
  • 4
    Never mind. It looks like MS deprecated your solution. That leaves the question unanswered again for VS2015. http://stackoverflow.com/questions/31752293/visual-studio-2015-user-tasks-gone – slashCoder Jun 28 '16 at 15:38
  • you can still use the Ctrl + K, Ctrl + H shortcut, just can't rename it after – tatigo Jun 05 '17 at 21:06
19

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.

  • This seems to be the best solution at the moment. The feature I want now is to navigate from bookmark in code to bookmark window which I cannot do in VS at the moment. – rajeemcariazo Sep 09 '21 at 03:15
2

The Edit and Continue feature will let you make simple changes to your code while debugging. If you your change is simple enough then you can make the change on the fly while coding. For more complicated changes, you can add a TODO comment of the form:

// TODO: Explanation of fix

You can see a list of all TODO comments by looking at the task list within Visual Studio.

Josh
  • 677
  • 2
  • 9
  • 18
  • I updated my question, Edit and Continue is enabled but not allowed (by Visual Studio) in my project – Keith K Feb 20 '13 at 15:15
  • I don't do a lot of ASP.Net myself so I haven't tried Edit and Continue in that environment. [This post](http://stackoverflow.com/questions/6168634/edit-and-continue-in-asp-net-mvc-3-application) seems helpful in getting it up and running. – Josh Feb 20 '13 at 15:54