I am using Bot Framework SDK v-4 and trying to use QnAMakerService
.
I have the BotService.cs
where I have the QnAMakerService
instatiations. While, initiating the QnAMakerService
I get an error in my Visual Studio Diagnostics window:
could not load type Microsoft.Bot.Builder.Internals.Fibers.SetField
Below is my code. I have commented the line where I get the error:
public BotServices(BotConfiguration botConfiguration)
{
foreach (var service in botConfiguration.Services)
{
switch (service.Type)
{
case ServiceTypes.QnA:
{
var qna = (Microsoft.Bot.Configuration.QnAMakerService)service;
if (qna == null)
{
throw new InvalidOperationException("The QnA service is not configured correctly in your '.bot' file.");
}
if (string.IsNullOrWhiteSpace(qna.KbId))
{
throw new InvalidOperationException("The QnA KnowledgeBaseId ('kbId') is required to run this sample. Please update your '.bot' file.");
}
if (string.IsNullOrWhiteSpace(qna.EndpointKey))
{
throw new InvalidOperationException("The QnA EndpointKey ('endpointKey') is required to run this sample. Please update your '.bot' file.");
}
if (string.IsNullOrWhiteSpace(qna.Hostname))
{
throw new InvalidOperationException("The QnA Host ('hostname') is required to run this sample. Please update your '.bot' file.");
}
string defaultMessage = "Sorry no answer found.";
QnAMakerAttribute qnAMakerAttribute = new QnAMakerAttribute(qna.EndpointKey, qna.KbId, defaultMessage, 40, 5, <end_point>);
var qnaMakerService = new Microsoft.Bot.Builder.CognitiveServices.QnAMaker.QnAMakerService(qnAMakerAttribute); // Error is here
qnaMakerServices.Add(qna.Name, qnaMakerService);
break;
}
}
}
}
I had used native Http
calls earlier with the same endpoint and it worked fine. Any idea what I am doing wrong?