我使用的是.NET Core 2.0。我创建了一个F#控制台应用程序。在Program.fs中我放了Suave WebSocket example code.
除了第84行,所有内容都会编译:
path "/websocketWithSubprotocol" >=> handShakeWithSubprotocol (chooseSubprotocol "test") ws
我收到这个错误
error FS0039: The value or constructor 'handShakeWithSubprotocol' is not defined. Maybe you want one of the following:↔ handShakeResponse↔ handShake
我搜索了Suave源代码,然后找到了handShakeWithSubprotocol
in WebSocket.fs。所以我认为这应该是可访问的,但编译器并不这么认为。
怎么可能出错?
你可以看到我的所有代码here。
我想我想出来了。
handShakeWithSubprotocol
不在v 2.2.1中,这是我正在使用的Suave的版本。 Looks like it was added 4 months ago according to blame.
Link to the source code tagged v2.2.1
Looks like it's not in 2.3.0-beta either.,但有一个拉动请求说它可能会进入2.3.0。