首先,我在Azure机器人框架中使用C#来使我的机器人与用户打招呼(发送第一条消息),但是当我输入所需的代码时,我会收到一串CS0535错误。
这是我的C#代码:
private Activity HandleSystemMessage(Activity message)
{
if (message.Type == ActivityTypes.DeleteUserData)
{
// Implement user deletion here
// If we handle user deletion, return a real message
}
else if (message.Type == ActivityTypes.ConversationUpdate)
{
// Handle conversation state changes, like members being added and removed
// Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
// Not available in all channels
ConnectorClient connector = new ConnectorClient(new Uri(message.ServiceUrl));
Activity reply = message.CreateReply("Hello from my simple Bot!");
connector.Conversations.ReplyToActivityAsync(reply);
}
else if (message.Type == ActivityTypes.ContactRelationUpdate)
{
// Handle add/remove from contact lists
// Activity.From + Activity.Action represent what happened
}
else if (message.Type == ActivityTypes.Typing)
{
// Handle knowing tha the user is typing
}
else if (message.Type == ActivityTypes.Ping)
{
}
return null;
}
这些是我收到的错误:
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.BaseUri' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.SerializationSettings' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.DeserializationSettings' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Credentials' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Attachments' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Controllers\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Conversations' [D:\home\site\wwwroot\Microsoft.Bot.Sample.QnABot.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\wwwroot\.\Microsoft.Bot.Sample.QnABot.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\wwwroot\.\.\\"
An error has occurred during web site deployment.
任何帮助将不胜感激