question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Operation is not supported on this platform in ASP.NET Core 2.0 application

See original GitHub issue
RestClient client;
client = new RestClient(Configuration.APIUrl);
            client.Authenticator = new HttpBasicAuthenticator(Configuration.Username, Configuration.Password);

RestRequest request = new RestRequest(Configuration.EndPoints.Clients, Method.GET);
            IRestResponse<ClientResult> response = client.Execute<ClientResult>(request);

            if (response.StatusCode != System.Net.HttpStatusCode.OK)
            {
                if (response.ErrorException != null)
                {
                    throw new Exception(response.ErrorMessage); // Error: Operation is not supported on this platform
                }
            }

Expected Behavior

Get the actual result in json, same call is working fine with HttpClient and in Postman

Actual Behavior

Error: Operation is not supported on this platform

Steps to Reproduce the Problem

Simple rest call setup

Specifications

ASP.NET Core 2.0 console application

StackTrace

``` 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.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse) ```

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
ed-grahamcommented, Dec 30, 2017

I can verify that 106.0.0-alpha0284 solves the problem. However, it is still present in later builds; e.g. 106.2.0-alpha0060.

0reactions
grantwinneycommented, Sep 27, 2018

No proxy server @alexeyzimarev. I’m on a Mac using Visual Studio for Mac. I copied the details to a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Operation is not supported on this platform" in a .NET Core ...
I made a POST request that works well with 106.2.2. Actual Behavior. I received the same "Operation is not supported on this platform."...
Read more >
System.PlatformNotSupportedException in .NET Core 2.0
I'm trying to compile an application made in .NET Core 2.0 but every time I try to login the post method throws the...
Read more >
Operation is not supported on this platform - Microsoft Q&A
the "Operation is not supported on this platform" error means the function was ported to .net core, but requires O/S support and was...
Read more >
.NET core vs .NET framework
NET Core is used to create server applications that run on Windows, Linux and Mac. It does not currently support creating desktop applications...
Read more >
.NET Core 3 Reporting - "Operation is not supported on this ...
I'm migrating my solution to net core 3, when I try to edit a report or print a report, it gives me an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found