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." MacOS #487

Open
qrpike opened this issue Sep 1, 2018 · 4 comments
Open

""Operation is not supported on this platform." MacOS #487

qrpike opened this issue Sep 1, 2018 · 4 comments

Comments

@qrpike
Copy link

qrpike commented Sep 1, 2018

My Application:

using WebSocketSharp;
using System;

namespace TestProject{
    class Program{
        static void Main(string[] args){
            WebSocket ws = new WebSocket("ws://localhost:9090/ws");
            ws.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
            ws.OnMessage += (sender, e) => {
                Console.WriteLine("Says:" + e.Data);
            };
            ws.ConnectAsync();
            ws.Send("Auth");
            Console.ReadKey( true );
        }
    }
}

Error:

System.PlatformNotSupportedException: "Operation is not supported on this platform."
  at System.Func`1.BeginInvoke(AsyncCallback callback, Object object)\n   at WebSocketSharp.WebSocket.ConnectAsync()\n   at TestProject.Program.Main(String[] args) in /Users/qrpike/Projects/TestProject/TestProject/Program.cs:15

System Details:

Visual Studio Community 2017 for Mac
Version 7.6.3 (build 1)
Installation UUID: 93217eed-bb8a-4b16-9e34-95aba35b01be
Runtime:
	Mono 5.12.0.301 (2018-02/4fe3280bba1) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

	Package version: 512000301

NuGet
Version: 4.3.1.4445

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.1.2
	2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.302/Sdks
SDK Versions:
	2.1.302
	2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.6.3
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 9.4.1 (14161)
Build 9F2000

Operating System
Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
    Thu Jun 21 22:53:14 PDT 2018
    root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
@Violetdusk
Copy link

.Net Core doesn't support BeginInvoke. The reason is well commented here.

@danielmackay
Copy link

This library supports .NET Standard, so this should work on .NET Core right?

I'm having this same issue with basically the same code. How can the code above be modified to work with .NET Core 3.1?

TIA

@otmanel31
Copy link

+1 same issue, any hints guys ? i'm on dotnet core 3.1. I test it on windows but it should be deployed on linux then ...

@otmanel31
Copy link

without response i switch to a standard websocket client ...

@schodemeiss schodemeiss mentioned this issue Dec 15, 2022
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

4 participants