gpt4 book ai didi

c# - 与本地模拟器发生连接错误

转载 作者:太空狗 更新时间:2023-10-30 01:08:27 24 4
gpt4 key购买 nike

在我的 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)

最佳答案

这可能看起来过于简单化...但请仔细检查默认应用程序是否确实是您的云应用程序项目而不是 ASP.NET/Web 项目。如果没有“Cloud”上下文,您肯定会得到 SHException 或类似的东西。

关于c# - 与本地模拟器发生连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9415302/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com