【发布时间】:2015-07-01 22:36:21
【问题描述】:
我在 Azure Web Apps (ASP.NET MVC 4) 中有一个应用程序,想将文件上传到 Azure 存储。 Web.config 配置了存储模拟器:
<appSettings>
...
<add key="StorageConnectionString" value="UseDevelopmentStorage=true" />
<add key="CloudStorageContainerReference" value="dnc-demo" />
</appSettings>
并且连接字符串是在Web.Release.config中配置的:
<connectionStrings>
<add name="StorageConnection" connectionString="DefaultEndpointsProtocol=https;AccountName=XXXX;AccountKey=XXX" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
问题是当我上传文件(在生产中)时出现以下错误:
[SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 127.0.0.1:10000]
我该如何解决??
谢谢!!
【问题讨论】:
-
好吧,鉴于它是
SocketException,我会说您的存储不是问题。你在使用什么 websocket 库,socket.io? -
您正在对
元素应用 web.config 转换,但在 appSettings 元素中定义它。 -
@GauravMantri 有什么解决方法的建议吗??
-
可以在 web.config 和 web.release.config 中使用
<connectionStrings>元素并在您的应用程序中使用StorageConnection连接字符串?现在,您似乎在应用程序中使用appSettings中的StorageConnectionString。 -
@GauravMantri 这就是问题所在,我将发布解决方案。非常感谢!!!
标签: c# asp.net azure azure-storage azure-blob-storage