<p>I'm trying to find a way to automate some exception logging code to add to the stack information already available.</p>

<p>Is there any way to use reflection to retrieve the values of all variables on the stack (locals and parameters) - I sincerely doubt the names of the variables are available, but in many cases it would be useful to see the values.</p>

Not really. For this level of digging you'd probably need something like WinDbg.
If a
specific
variable is of interest, you can add it to the exception yourself (although even this introduces issues with duplicate keys, re-entrancy, etc):
```
```
string dir = ...todo...
    try
    {
        // some code
    }
    catch (Exception ex)
    {
        ex.Data.Add("dir", dir);
        throw;
    }
```
```