title: Using Environment.ExitCode versus returning int from Main
body: <p>I am planning to use the return code of the C# executable in one of my shell script. I have two options:</p>
  
  <p><strong>Returning a int value from the main method</strong></p>
  
  <pre><code>class MainReturnValTest
  {
      static int Main()
      {
          //...
          return 0;
      }
  }
  </code></pre>
  
  <p><strong>(OR)</strong></p>
  
  <p><strong>Using Environment.Exit with an exit code</strong></p>
  
  <pre><code>class MainReturnValTest
  {
      static void Main()
      {
          //...
          Enviroment.Exit(exitCode);
      }
  }
  </code></pre>
  
  <p>Is it fine to use any of the above ways to return value from the executable? Or is one of them preferred over other?</p>