编程语言
首页 > 编程语言> > c# – 与本地仿真器出现连接错误

c# – 与本地仿真器出现连接错误

作者:互联网

在我的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或类似的东西.

标签:c,azure,azure-table-storage
来源: https://codeday.me/bug/20190621/1250960.html