如何强制CloudTableClient使用在IE中配置的默认代理或使用代理地址连接到Internet

时间:2010-11-11 11:03:17

标签: .net azure azure-storage

当我尝试从我的代码连接时,我收到以下异常。但NeudesicLLC的AzureStorageExplorer能够通过检测IE中配置的代理服务器设置进行连接。无论如何都要强制CloudTableClient使用代理设置吗?

无法解析远程名称:'mystorage.table.core.windows.net',System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)的堆栈跟踪    在System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)

at Microsoft.WindowsAzure.StorageClient.Tasks.Task 1.get_Result() at Microsoft.WindowsAzure.StorageClient.Tasks.Task 1.ExecuteAndWait()    在Microsoft.WindowsAzure.StorageClient.CloudTableClient.CreateTableIfNotExist(String tableName)

2 个答案:

答案 0 :(得分:2)

谢谢smarx。您的评论确认我默认选择了代理设置。所以我去改变登录用户为我的Windows服务谁是互联网用户,它工作。非常感谢。之前,该服务已配置为以本地系统帐户运行。所以它与AzureClient无关。故障发生在Windows服务用户配置上。

答案 1 :(得分:1)

或者,您可以使用配置文件的system.net/defaultproxy设置代理设置,如下所示

<configuration>
 <system.net>
    <defaultProxy>
      <proxy
        proxyaddress="http://MyProxyServer"
        bypassonlocal="true"
      />
    </defaultProxy>
  </system.net>
</configuration>