Time for some more fun with VisualStudio macros.
Lets consider this common scenario: You open a project to make a minor adjustment and then realize that in order to compile that project, you need to add all the dependencies (project references) to your solution. For larger projects, that could be a LOT of projects to add… AND you may have to do this recursively! take a look at the reference, locate the project file, add it to your solution, repeat. Since I am indeed THAT lazy, I created a macro to do that for me.
Have you ever tried adding a new reference to lots of projects in a very large application? If you have, you know this already and if you haven’t, let me tell you: it gets old really fast… Open project, right click the project, click on “Add Reference…” and so on. As an inherently lazy demographic, this simply is not an options for us developers. So what do we do? We automate it with a VisualStudio macro.
If you need to debug in special condition, like you got a loop and you want to debug the 34th item, you could either set a breakpoint and just skip it 33 times (by pressing f5) or you could simply add a condition to this breakpoint.
You do this by right-clicking the breakpoint and choosing
There you can enter any valid C#-Expression, like
"ssList[counter] == 1947635". Now the breakpoint is only hit if this condition is true.