在我的Azure应用程序中,当我尝试连接到本地模拟器时,我收到错误.
CloudStorageAccount CSC = CloudStorageAccount.Parse(
RoleEnvironment.GetConfigurationSettingValue("connection"));
在CS Def
<ConfigurationSettings>
<Setting name="connection" />
</ConfigurationSettings>
在.cscfg中
<Role name="Webrole1">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="connection" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
堆栈跟踪:
at RdGetApplicationConfigurationSetting(UInt16* , UInt16** )
at RoleEnvironmentGetConfigurationSettingValueW(UInt16* pszName, UInt16* pszDest, UInt32 cchDest, UInt32* pcchrequiredDestSize)
at Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String& ret)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName)
at Webrole1._Default.Page_Load(Object sender, EventArgs e) in c:\users\gowdes\documents\visual studio 2010\Projects\WindowsAzureProject20\Webrole1\Default.aspx.cs:line 19
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterasyncPoint)
解决方法:
这可能看起来过于简单……但请仔细检查默认应用程序确实是您的Cloud Application项目而不是ASP.NET / Web项目.如果没有“云”上下文,您肯定会得到SHException或类似的东西.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。