You can more or less run any statements in the immediate window in visual studio. This is a quick demo on how to extract data when your code hit's an unhandled exeption after a long run.
The other day I ran some test code against an API and then dump the result to a logg file. Creating my logg file failed due to bad formatting of the file name. So I just created a new file via the immediate window in visual studio to dump the result.
Here is a quick demo I put together so you can try it your self.
Visit my blogg Hackviking