在Microsoft博特框架教程Get Started下面的代碼'Extensions.GetBotPerUserInConversationData <TypeT>(消息字符串)' 拋出異常
if (message.Type == "Message")
{
// fetch our state associated with a user in a conversation. If we don't have state, we get default(T)
var counter = message.GetBotPerUserInConversationData<int>();
// create a reply message
Message replyMessage = message.CreateReplyMessage($"{++counter} You said:{message.Text}");
// save our new counter by adding it to the outgoing message
replyMessage.SetBotPerUserInConversationData(counter);
// return our reply to the user
return replyMessage;
}
具有兩種編譯器錯誤
Error CS7036 There is no argument given that corresponds to the required
formal parameter 'property' of
'Extensions.GetBotPerUserInConversationData<TypeT>(Message, string)'
和
Error CS7036 There is no argument given that corresponds to the required
formal parameter 'data' of
'Extensions.SetBotPerUserInConversationData(Message, string, object)'
假設是另一個圖書館t擴展了「消息」類?我無法在MSDN上找到參考或文檔。
謝謝,你是對的,那些是編譯器錯誤,而不是例外。我早上五點就是蘇寧;) –