Azure / azure-webpubsub

Azure Web PubSub Service helps you to manage WebSocket connections and do publish and subscribe in an easy way
https://azure.github.io/azure-webpubsub/
MIT License
132 stars 84 forks source link

csharp simplechat doesn't build #205

Closed alteredtastes closed 3 years ago

alteredtastes commented 3 years ago

Describe the bug

I followed the exact instructions for /samples/functions/csharp/simplechat

I have a Web PubSub resource created on my Azure account and configured it as specified in the instructions. I then copied the connection string into local.settings.json.

func extensions install does not install anything. it prints "No action performed because no functions in your app require extensions."

func start does not build successfully. it prints with 5 errors..

Build FAILED.

/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/Functions.cs(58,28): error CS0103: The name 'MessageDataType' does not exist in the current context [/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/SimpleChat.csproj]
/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/Functions.cs(70,28): error CS0103: The name 'MessageDataType' does not exist in the current context [/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/SimpleChat.csproj]
/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/Functions.cs(83,28): error CS0103: The name 'MessageDataType' does not exist in the current context [/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/SimpleChat.csproj]
/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/Functions.cs(89,28): error CS0103: The name 'MessageDataType' does not exist in the current context [/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/SimpleChat.csproj]
/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/Functions.cs(102,28): error CS0103: The name 'MessageDataType' does not exist in the current context [/home/sgilfillan/Projects/playground-repos/azure-webpubsub/samples/functions/csharp/simplechat/SimpleChat.csproj]
    0 Warning(s)
    5 Error(s)

To Reproduce

Exceptions (if any)

Further technical details

JialinXin commented 3 years ago

@alteredtastes, Thanks for reporting the issue. The sample is out of data with a small change in 1.0.0-beta.2. The MessageDataType is moving to namespace Azure.Messaging.WebPubSub, so you need to add a using in the header as below. I'll fix the sample.

using Azure.Messaging.WebPubSub;