RestSharp: "Operation not supported on this platform" on Core 2, stable release 106.2.0
Expected Behavior
Request should be performed
Actual Behavior
Request is not performed. Error is encountered
Steps to Reproduce the Problem
var client = new RestClient("http://example.com");
var request = new RestRequest("/", Method.GET);
var response = client.Execute(request);
// response.IsSuccessful == false, response.ErrorMessage == "Operation not supported on this platform"
Specifications
- Version: 106.2.0
- Platform: .Net Core 2.0
No proxy is defined
StackTrace
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Net.SystemWebProxy.GetProxy(Uri destination)
at System.Net.ServicePointManager.ProxyAddressIfNecessary(Uri& address, IWebProxy proxy)
at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy)
at System.Net.HttpWebRequest.get_ServicePoint()
at RestSharp.Http.ConfigureWebRequest(String method, Uri url)
at RestSharp.Http.GetStyleMethodInternal(String method)
at RestSharp.Http.AsGet(String httpMethod)
at RestSharp.RestClient.DoExecuteAsGet(IHttp http, String method)
at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 18 (4 by maintainers)
Commits related to this issue
- Fixing #1061 — committed to restsharp/RestSharp by deleted user 6 years ago
When I rollback to 106.1.0, it works. Hope someone will fix it for next release.
Rolling back to 106.1.0 helps me too. I’ve the same issue at 106.2
Yeah, I admit I messed up trying to satisfy people using full framework, who lost the proxy completely. 106.2.1 fixes it.
Hence that .NET Core will not support the default proxy. You either go without any proxy (default) or specify your own proxy by using
RestClient.Proxyproperty setter.Full framework version works as before, supporting proxy detection.
https://www.nuget.org/packages/RestSharp/106.2.1