title: Cannot obtain value because it has been optimized away
body: <p>I have a problem with debugging...
  All of a sudden I can't see the values of most variables while debugging.
  I've managed to get two different messages in the Immediate Window:</p>
  
  <blockquote>
    <p>Cannot obtain value of local or argument 'parameter' as it is not available at this instruction pointer, possibly because it has been optimized away.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Internal error in the expression evaluator.</p>
  </blockquote>
  
  <p>I've tried and checked the following things:</p>
  
  <ol>
  <li>Solution Configuration is set to debug (<strong>not</strong> release)</li>
  <li>Project -> Settings -> Build -> Optimize code is <strong>not</strong> set</li>
  <li>Tools -> Options -> Debugging -> Use Managaed Compatibility Mode (didn't work)</li>
  </ol>
  
  <p>Do you have any further ideas how I can properly debug again? :(</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>Edit</strong>
  The code is nothing special.. it happens when I try to watch what's inside parameter[Key]</p>
  
  <pre><code>public void AddOrUpdateQuartzJob(string jobName, IList&lt;KeyValuePair&lt;string, string&gt;&gt; parameters)
      {
          var jobDetail = this.GetJobDetail(jobName);
  
          if (jobDetail != null)
          {
              foreach (var parameter in parameters)
              {
                  jobDetail.JobDataMap[parameter.Key] = parameter.Value;
              }
          }
          else
          {
              this.ScheduleNewJob(jobName, parameters);
          }
      }
  </code></pre>