title: Error in goto. (C#)
body: <p>I'm making a fake shell program, and I want to be able to trigger an error screen by inputting a certain line of code.</p>
  
  <p>Here's the affected bit of my code:</p>
  
  <pre><code>                Console.Title = "Command Prompt";
                  OperatingSystem os = Environment.OSVersion;
                  Version ver = os.Version;
                  ver.ToString();
                  if (os.VersionString.Equals("Microsoft Windows NT 6.2.9200.0"))
                          {
                                  Console.WriteLine("Microsoft Windows [Version 6.3.9600]");
                                  Console.WriteLine("(c) 2013 Microsoft Corporation. All rights reserved. \n");
                                  goto a;
                          }
  
                  else
     ver_error:
                  {
                      Console.WriteLine("Error: OS '" + os.VersionString + "' Missing from libraries, \nnot yet implemented?\n");
                      Console.WriteLine("Available Operating Systems:\nWndows 8.1, Microsoft Windows NT 6.2.9200.0 ");
                      Thread.Sleep(3000);
                      Console.WriteLine("\n\nPress enter to boot Error Protocol, type exit to exit.\n");
                  error_test:
                      string errorProtocol;
                      errorProtocol = Console.ReadLine();
                      if (errorProtocol.Equals("")) 
                              {
                                  Console.WriteLine("Booting Error Protocol...");
                                  Thread.Sleep(2000);
                                  goto error_report;
                              }
                      else if (errorProtocol.Equals("exit"))
                              {
                                  goto end;
                              }
                      else
                              {
                                  Console.WriteLine("Not a valid response.");
                                      goto error_test;
                              }
                  }
      /* C:\Users\18LeunJA dir */
      a:
                  Console.Write("C:\\Users\\18LeunJA&gt;");
                  string userValueFromStart;
                  userValueFromStart = Console.ReadLine();
                  if (userValueFromStart.Equals("exit"))
                          {
                                  goto end;
                          }
                  else if (userValueFromStart.Equals("triggerOSError"))
                  {
                      goto ver_error;
                  }
  </code></pre>
  
  <p>The affected code is the "ver_error:" line. Can anyone tell me why this doesn't work?</p>
  
  <p>EDIT: I have attempted moving the ver_error inside the else body, but instead, it says the label has not been referenced, and that there is 'No such label 'ver_error' within the scope of the goto statement.</p>
  
  <p>When outside, the error 'Embedded statement cannot be a declaration or labelled statement' appears.</p>