Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operation is not supported on this platform. #652

Open
yuzhupeng opened this issue Feb 24, 2021 · 8 comments
Open

Operation is not supported on this platform. #652

yuzhupeng opened this issue Feb 24, 2021 · 8 comments

Comments

@yuzhupeng
Copy link

Operation is not supported on this platform. ???what problem

@yuzhupeng
Copy link
Author

log:

{ "system": "Meowv.Blog", "datetime": "2021-02-24 23:00:24,733", "description": "binance:System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Action1.BeginInvoke(T obj, AsyncCallback callback, Object object) at WebSocketSharp.WebSocket.open() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 1554 at WebSocketSharp.WebSocket.Connect() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 3235 at GetTradeHistoryData.binanceWebscoket.Start(String senddata) in C:\Users\Administrator\Desktop\chenxu\GetTradeHistoryData\Futures\BINANCE\binanceWebscoket.cs:line 104", "level": "ERROR", "info": "" } { "system": "Meowv.Blog", "datetime": "2021-02-24 23:00:25,725", "description": ":System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Action1.BeginInvoke(T obj, AsyncCallback callback, Object object)
at WebSocketSharp.WebSocket.open() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 1554
at WebSocketSharp.WebSocket.Connect() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 3235
at GetTradeHistoryData.binanceUSDWebscoket.Start(String senddata) in C:\Users\Administrator\Desktop\chenxu\GetTradeHistoryData\Futures\BINANCE\binanceUSDWebscoket.cs:line 101", "level": "ERROR", "info": "" }
{ "system": "Meowv.Blog", "datetime": "2021-02-24 23:02:03,656", "description": "binancewebsocket_Closed", "level": "ERROR", "info": "" }
{ "system": "Meowv.Blog", "datetime": "2021-02-24 23:02:04,049", "description": "binancewebsocket_Closed", "level": "ERROR", "info": "" }
{ "system": "Meowv.Blog", "datetime": "2021-02-24 23:03:08,490", "description": ":System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Action`1.BeginInvoke(T obj, AsyncCallback callback, Object object)
at WebSocketSharp.WebSocket.open() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 1554
at WebSocketSharp.WebSocket.Connect() in C:\Users\Administrator\Desktop\chenxu\websocket-sharp\WebSocket.cs:line 3235
at GetTradeHistoryData.binanceWebscoket.Start(String senddata) in C:\Users\Administrator\Desktop\chenxu\GetTradeHistoryData\Futures\BINANCE\binanceWebscoket.cs:line 104", "level": "ERROR", "info": "" }

@BossOfGames
Copy link

Are you by chance using .NET Core? I noticed that this issue is specifically related to the fact this project wasn't compiled against Core. I have no problems using .NET Standard.

@PhilippElhaus
Copy link

I have this too in .NET 5 WPF

@davlovsky
Copy link

Same here. Winforms, after migrating from .NET Framework to .NET 5.

@PhilippElhaus
Copy link

Switched to the latest NuGet of WebSocket4Net - is similar to code and works just fine.

@davlovsky
Copy link

I had this line in my old code:
Websocket.SslConfiguration.ServerCertificateValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };

Do you know if there is a WebSocket4Net analog?

@henon
Copy link

henon commented Apr 7, 2022

One workaround is to use Connect instead of ConnectAsync and Send instead of SendAsync and if that doesn't work for you switch to https://github.com/sipsorcery/websocket-sharp

@schodemeiss schodemeiss mentioned this issue Dec 15, 2022
@acd450
Copy link

acd450 commented Jan 18, 2024

With a .Net6 project, I used Close instead of CloseAsync and no longer had this error. Using Connect and Send as well, thanks to @henon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants