.NET Core 1.0.0-preview3-004056 MacOSX El Capitan-System.NET.Http.CurlException:canned';无法解析主机名

.NET Core 1.0.0-preview3-004056 MacOSX El Capitan-System.NET.Http.CurlException:canned';无法解析主机名,.net,curl,httpclient,.net,Curl,Httpclient,我正在向Oauth2服务运行一个HttpClient“Post”来检索令牌 var httpClient = new HttpClient(handler); //HttpClient httpClient = new HttpClient(); httpClient.BaseAddress = tokenRequestBaseUri; List<KeyValuePair<string, string>> nameValueCollection = new List&

我正在向Oauth2服务运行一个HttpClient“Post”来检索令牌

var httpClient = new HttpClient(handler);

//HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = tokenRequestBaseUri;

List<KeyValuePair<string, string>> nameValueCollection = new List<KeyValuePair<string, string>>();
nameValueCollection.Add(new KeyValuePair<string, string>("grant_type", "client_credentials"));

System.Net.Http.FormUrlEncodedContent formContent = new FormUrlEncodedContent(nameValueCollection);

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, URIHelper.GetUAATokenRequestRelativeUri());

request.Content = formContent;

string clientId_clientSecret = Convert.ToBase64String(Encoding.UTF8.GetBytes(tenantInformation.ClientId_svcops + ":" + tenantInformation.ClientSecret_svcops));
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", clientId_clientSecret);

logger.Debug("Sending Http Request");

var httpResponseMessage = await httpClient.SendAsync(request);
无法解析主机名

但如果我打开浏览器,我可以浏览该Url

有什么帮助吗


感谢使用Visual Studio 2017 RC和.NET Core SDK的预览版3解决了这个问题


它使Windows和MAC OS上的框架版本保持一致。

使用Visual Studio 2017 RC和.NET Core SDK的预览版3解决了这个问题


它使Windows和MAC OS上的框架版本保持一致。

可能是coreClr中的一个问题。您应该在github上发布问题,而不是在此处发布。(特别是在使用预览构建版本时)这已经发布在Github上了吗?我收到了一个类似的问题。可能是coreClr中的问题。你应该在github上发布问题,而不是在这里发布。(特别是在使用预览构建版本时)这已经发布在Github上了吗?我也遇到了类似的问题。
System.AggregateException: One or more errors occurred. (An error occurred while sending the request.) ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Couldn't resolve host name
   at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
   at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)