botframework icon indicating copy to clipboard operation
botframework copied to clipboard

Getting some compile errors after upgrading the QnAMakerDialog nuget package

Open rickengle opened this issue 6 years ago • 0 comments

Hi, I have been using QnAMakerDialog for handing some of my botframework questions and I just updated the Nuget package to 3.0.0 and am getting 2 compile errors in QnaDialog.cs. They are:

Error CS0246 The type or namespace name 'QnAMakerResult' could not be found (are you missing a using directive or an assembly reference?) Error CS0115 'QnADialog.DefaultMatchHandler(IDialogContext, string, QnAMakerResult)': no suitable method found to override

My code behind is this which was working before the upgrade:

`using System; using System.Threading.Tasks; using Microsoft.Bot.Builder.Dialogs;

using Newtonsoft.Json.Linq; using QnAMakerDialog;

namespace LuisBot.Dialogs { [Serializable] [QnAMakerService("c355bee79baa424c8bc4c85f14b31892", "41918fa1-2f6a-4ebd-a9ec-682265481121")] public class QnADialog : QnAMakerDialog { public override async Task NoMatchHandler(IDialogContext context, string originalQueryText) { string message = $"Sorry, I did not understand '{originalQueryText}'. Type 'help' if you need assistance.";

        context.Done(false);
    }

    public override async Task DefaultMatchHandler(IDialogContext context, string originalQueryText, QnAMakerResult result)
    {
        await context.PostAsync($"{result.Answer}");

        context.Done(true);
    }
}

}`

The errors are occurring on the 2 override lines. Can you spot what the issues are? I looked at your sample project and the lines seem to match.

Thanks, Rick

rickengle avatar Mar 19 '18 16:03 rickengle