Ok, I'll answer my own question because I really think this sort of feature should be included in .net IDE's of the future.
Imagine debugging code and while stepping, and a section of code is highlighted, right click and then select throw exception. A drop down list is provided with pre-defined exceptions or else just a general new exception. This way you can test code much quicker without having to write specific test cases.
I also don't believe that writing test cases is always possible. For example, lets say I am requesting data from a web service. And I want to catch the following exceptions: SSL Trust Failure, Connection refused , 404 resource not found. I would be amazed if there are ways to write these test cases, when the service you're requesting is not your own. In these cases imagine how much better it would be if you could just step in, and at the required point, right click, select throw new exception - then via a dialog select the exact type of exception you want. . In this case you run the code once in debug mode, each time you want to test for a new exception type, just doing the right click thing. Not having to stop / start the debugger or have any temporary throw exceptions coded all over the place which will ultimately need to come out for a production release.
I'll also mention you should also be able to step back out of the catch sections, which is not currently possible as far as I know.
Anyways, as far as I know the best way to trigger an exception like this at debug time dynamically - is to drag and drop the debug location to a point where it was relying on code to run previously that never did, hence making the current line of code you drop on invalid. This is the only way I know how to do this, so if you know any other way please leave a better answer.
To illustrate my point
- Create Dir
- Create File in Dir
If you don't run line 1, by dragging and dropping the debugger onto line 2, then line2 will now throw an exception because now the directory does not exist, which would have if the code had run normally.
Lol - if I worked for VS team, you would all be much happier developers.