dotnet / WatsonWebserver

Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
MIT License
406 stars 83 forks source link

macOS / .NET Core 2.1 not supported #14

Closed frankhommers closed 5 years ago

frankhommers commented 5 years ago

I get this error.

An unhandled exception of type 'System.PlatformNotSupportedException' occurred in System.Private.CoreLib.dll: 'The named version of this synchronization primitive is not supported on this platform.'

jchristn commented 5 years ago

Hi @frankhommers are you running on Mac/Linux? Edit: sorry, I just saw the title. Will investigate.

jchristn commented 5 years ago

The problem seems to be with incompatibility on line 34: private readonly EventWaitHandle Terminator = new EventWaitHandle(false, EventResetMode.ManualReset, "UserIntervention");. I'll have to find a way to keep it active in the background in a way that is supported by .NET Core 2.1.

jchristn commented 5 years ago

I found a fix and will get it integrated today or tomorrow. Thanks for letting me know @frankhommers

jchristn commented 5 years ago

Hi @frankhommers I just uploaded an updated package to NuGet: https://www.nuget.org/packages/Watson/1.3.1 with this commit: https://github.com/jchristn/WatsonWebserver/commit/38722558b856ee692631b448653248b57ded88bd - please reopen if any issues. Thanks!

jchristn commented 5 years ago

Also for anyone interested in what the issue was: https://stackoverflow.com/questions/53526755/net-core-2-1-eventwaithandle-not-supported

frankhommers commented 5 years ago

Thanks for the fix!

But I already used the HttpListener itself, because there weren't any nupkg's that worked flawlessy on macOS.

I'm not sure I'll have time to re-integrate watson in my project. I'll probably use it in a next project (don't know when yet).

Again thanks for fixing it!