title: nested foreach loops with switch statement not incrementing case variable
body: <p>I have this code:</p>
  
  <pre><code>                foreach(List&lt;string&gt; build in Builds)
                  {
                      int i = 0;
                      foreach(string item in build)
                      {
                          switch (i)
                          {
                              case 0:
                                  Console.WriteLine("BuildID: " + item);
                                  break;
                              case 1:
                                  Console.WriteLine("UserID: " + item);
                                  break;
                              case 2:
                                  Console.WriteLine("Parameter 1: " + item);
                                  break;
                              case 3:
                                  Console.WriteLine("Parameter 2: " + item);
                                  break;
                              case 4:
                                  Console.WriteLine("Parameter 3: " + item);
                                  break;
                              case 5:
                                  Console.WriteLine("Parameter 4: " + item);
                                  break;
                          }
                          i++;
                          Console.WriteLine(i);
                      }
                  }
  </code></pre>
  
  <p>and the output is:</p>
  
  <pre><code>BuildID: 1
  1
  BuildID: 1
  1
  BuildID: a
  1
  BuildID: b
  1
  BuildID: c
  1
  BuildID: d
  1
  </code></pre>
  
  <p>The items in the List are incrementing and being displayed properly (1,1,a,b,c,d) but for a reason i dont know, the incrementation of the 'i' counter is being forgotten after the switch executes? I don't understand? The expected output should be:</p>
  
  <pre><code>BuildID: 1
  1
  UserID: 1
  2
  Parameter 1: a
  3
  Parameter 2: b
  4
  Parameter 3: c
  5
  Parameter 4: d
  6
  </code></pre>