我试图这样调用RoleEnvironment.GetConfigurationSetting("SOMEKEY")
:
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;
}
我的ServiceConfiguration.cscfg键看起来是这样的:
<Setting name="CHARGIFY_API_KEY" value="AbCdEfGhIjKlMnOp" />
我遇到了这个错误:
异常详细信息:System.Runtime.InteropServices.SEHException: 外部组件引发了一个异常。
[SEHException (0x80004005): 外部组件引发了一个异常。] RoleEnvironmentGetConfigurationSettingValueW(UInt16* , UInt16* , UInt32 , UInt32* ) +0 Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String& 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
SEHException
的catch块中时,Marshal.GetExceptionCode()
返回什么? - Stephen ClearyMarshal.GetExceptionCode()
时,返回了"-1066598274"。 - Kori