如何强制CloudTableClient使用IE中配置的默认代理或使用代理地址连接到互联网
当我尝试从我的代码连接时,出现以下异常。但是 NeudesicLLC 的 AzureStorageExplorer 能够通过检测 IE 中配置的代理服务器设置进行连接。是否有强制 CloudTableClient 使用代理设置的方法?
无法解析远程名称:“mystorage.table.core.windows.net”,堆栈跟踪位于 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 在 System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)
在 Microsoft.WindowsAzure.StorageClient.Tasks.Task1.get_Result() 在 Microsoft.WindowsAzure.StorageClient.Tasks.Task
1.ExecuteAndWait() 在 Microsoft.WindowsAzure.StorageClient.CloudTableClient.CreateTableIfNotExist(String tableName)
I am getting the following exception when i try to connect from my code. But NeudesicLLC's AzureStorageExplorer is able to connect by detecting the proxy server settings which is configured in IE. Is there anyway to enforce the CloudTableClient to use the proxy settings?
The remote name could not be resolved: 'mystorage.table.core.windows.net', stack trace at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.Tasks.Task1.get_Result()
1.ExecuteAndWait()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task
at Microsoft.WindowsAzure.StorageClient.CloudTableClient.CreateTableIfNotExist(String tableName)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢斯玛克斯。您的评论证实我默认选择代理设置。所以我去改变了我的Windows服务的登录用户,即互联网用户,它起作用了。多谢。早些时候,该服务被配置为以本地系统帐户运行。所以它与AzureClient无关。故障出在 Windows 服务用户配置上。
Thanks smarx. your comment confirmed me that proxy settings are picked by default. so i went and changed the log-on user for my windows service who is internet user, it worked. Thanks a lot. Earlier the service was configured to run as local system account. So its nothing to do with AzureClient. The fault was on the windows service user configuration.
或者,您可以使用配置文件的 system.net/defaultproxy 设置代理设置,如下所示
Alternatively you can set the proxy settings with the system.net/defaultproxy of the configuration file like the following