title: Why am I getting SEHException when calling RoleEnvironment.GetConfigurationSettingValue("MYKEY")?
body: <p>I'm trying to call <code>RoleEnvironment.GetConfigurationSetting("SOMEKEY")</code> like so:</p>
  
  <pre><code>public partial class AzureBasePage : System.Web.UI.Page
  {
      protected ChargifyConnect Chargify
      {
          get {
              if (this._chargify == null) {
                  this._chargify = new ChargifyConnect();
                  this._chargify.apiKey = RoleEnvironment.GetConfigurationSettingValue("CHARGIFY_API_KEY");
              }
              return this._chargify;
          }
      }
      private ChargifyConnect _chargify = null;
  }
  </code></pre>
  
  <p>My ServiceConfiguration.cscfg key looks like this:</p>
  
  <pre><code>&lt;Setting name="CHARGIFY_API_KEY" value="AbCdEfGhIjKlMnOp" /&gt;
  </code></pre>
  
  <p>And I get this error:</p>
  
  <blockquote>
    <p>Exception Details: System.Runtime.InteropServices.SEHException: External component has thrown an exception.</p>
    
    <p>[SEHException (0x80004005): External component has thrown an exception.]
       RoleEnvironmentGetConfigurationSettingValueW(UInt16* , UInt16* , UInt32 , UInt32* ) +0
       Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String&amp; ret) +92
       Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName) +67
       ChargifyNET.ChargifyAzurePage.get_Chargify() in C:\NetProjects\ChargifyDotNET\Source\Chargify.NET\ChargifyAzurePage.cs:26
       Chargify.Azure._Default.Page_Load(Object sender, EventArgs e) in C:\NetProjects\ChargifyDotNET\Source\Chargify.Azure\Default.aspx.vb:8
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627</p>
  </blockquote>