I have the following weird situation.
I am trying to execute the following sequence of code within a WCF service, hosted in IIS 7.5 Express:
var request = WebRequest.Create(some_uri) as HttpWebRequest;
request.Method = "GET";
request.Credentials = CredentialCache.DefaultNetworkCredentials;
request.GetResponse();
When executed from a WCF service, I get the following exception:
[WebException: Unable to connect to the remote server]
and its inner exception:
[SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:400]
The same sequence of code from the console application is executed successfully.
I tried the following things for the code running under IIS 7.5 Express:
Now, I have several questions:
IIS代码在IIS用户帐户下运行,该帐户可能未配置您的代理。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.