title: C# Environment.GetEnvironmentVariable(...) Not Working on OSX
body: <p>I am running a console application on OSX that has the following...</p>
  <pre class="lang-cs prettyprint-override"><code>public static void main(string[] args)
  {
      string mongoEndpoint = Environment.GetEnvironmentVariable(&quot;MONGO_ENDPOINT&quot;);
  
      if(string.IsNullOrEmpty(mongoEndpoint))
      {
          _log.Fatal(&quot;Invalid Mongo Endpoint&quot;);
          throw new Exception(&quot;Invalid Mongo Endpoint&quot;);
      }
  }
  </code></pre>
  <p>I have added a <code>MONGO_ENDPOINT</code> environment variable to my <code>~/.bash_profile</code> and when I run <code>echo $MONGO_ENDPOINT</code> it outputs the correct value.</p>
  <p>However, when I run my console application from Xamarin Studio in OSX, it returns null.</p>
  <p>I tried running the following to see if it was all environment variables, and it returned the correct value.</p>
  <pre><code>Console.Out.WriteLine(Environment.GetEnvironmentVariable(&quot;HOME&quot;));
  </code></pre>
  <p>and it outputted <code>/usr/myname</code> perfectly fine.</p>
  <p>Any reason why it would not be able to find this environment variable?</p>