Shaun Luttin
Shaun Luttin

Reputation: 141712

The name ... does not exist in the current context... how do we switch contexts?

I've put a break point into an anonymous method like this:

Breakpoint in Anonymous Method

How can I retrieve the value of the configuration variable in the watch window? It keeps complaining that "The name 'configuration' does not exist in the current context."

I imagine that that's because the current context is a thread that doesn't have that variable. How can I switch the context to see the value?

Upvotes: 1

Views: 1611

Answers (1)

Frank Bryce
Frank Bryce

Reputation: 8446

In your code snippet, it looks like configuration is being returned as a result of an await operation. The line that is being executed is awaiting the configuration result, and should not be executed until configuration is set. When the breakpoint is first hit, however, configuration probably is not set yet.

UPDATE: to see the value of configuration, I presume that you can step over that line of code and configuration should be set to what it was then the line actually executed.

UPDATE: it looks like this is a known issue that has been fixed. Do you have the latest beta of VS2015?

Upvotes: 3

Related Questions