2013-03-23 233 views
4

GetResponse在我的本地机器上正常工作,但部署到Windows Azure时,我收到以下异常。我的ASP.NET网站运行一个我创建的exe文件作为新进程,它是exe中遇到下面列出的异常的代码。任何人都可以建议我可以看看解决这个问题的可能的权限设置?Windows Azure - NetworkInformationException(0x80004005):访问被拒绝 - HttpWebRequest

HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest; 
request.UserAgent = _userAgent; 
request.Timeout = 50000; 
HttpWebResponse response = request.GetResponse() as HttpWebResponse; 

System.Net.NetworkInformation.NetworkInformationException(0X80004005):访问是在System.Net.NetworkInformation.SystemIPGlobalProperties.GetFixedInfo() 在System.Net.NetworkInformation.SystemIPGlobalProperties.get_FixedInfo() 在系统拒绝 .Net.NetworkInformation.SystemIPGlobalProperties.get_HostName() at System.Net.NclUtilities.GuessWhetherHostIsLoopback(String host) at System.Net.ServicePoint.get_ConnectionLimit() at System.Net.ConnectionGroup..ctor(ServicePoint servicePoint,String connName ) at System.Net.ServicePoint.SubmitRequest(HttpWebRequest请求字符串CONNNAME) 在System.Net.HttpWebRequest.SubmitRequest(的ServicePoint服务点) 在System.Net.HttpWebRequest.GetResponse()

+0

您可以在发生这种情况时在代码中发布'完整'堆栈跟踪+相关行吗? – astaykov 2013-04-02 11:22:03

回答

2

需要更多的信息,但我首先想到的是,你是:

  • 尝试将套接字连接到特权端口绑定(端口< = 1024)
  • 尝试将插座到一个IP你没有这样的机器
  • 用户在绑定本地网站运行该代码具有更高的权限某种比用户Windows Azure(例如IIS AppPool?)运行它为
2

尝试从具有特定凭证的asp.net启动流程..即使用本地用户凭证。 azure可能会阻止未经身份验证的进程访问互联网。