Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 属性';路易斯莫德';对此声明类型无效_C#_Botframework - Fatal编程技术网

C# 属性';路易斯莫德';对此声明类型无效

C# 属性';路易斯莫德';对此声明类型无效,c#,botframework,C#,Botframework,我正在尝试使用botbuilder Botframework完成一个非常基本的bot。问题在于luis.ai集成。我将luis.ai与一个.js文件一起使用,但当我试图引用我的c#project时,标题中出现了错误 using System; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; // using System.Web.Http; // using Sys

我正在尝试使用botbuilder Botframework完成一个非常基本的bot。问题在于luis.ai集成。我将luis.ai与一个.js文件一起使用,但当我试图引用我的c#project时,标题中出现了错误

using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
// using System.Web.Http;
// using System.Web.Http.Description;
// using System.Collections.Generic;
// using Microsoft.Bot.Connector;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
// using Newtonsoft.Json;


namespace MyBot
{
    [LuisModel("80ba6a3b-8f62-47e6-81d0-350211b85580", "9b593fab21d54a328c0b9aeb0a64138b")]

    [LuisIntent("")]
    public async Task None(IDialogContext context, LuisResult result)
    {
        string message = "I'm sorry I didn't understand. Try asking about your bill.";
        await context.PostAsync(message);
        context.Wait(MessageReceived);
    }

    [LuisIntent("NextInvoiceDate")]
    public async Task NextInvoiceDate(IDialogContext context, LuisResult result)
    {
        string message = "Your next payment will go out on the 17th of the month.";
        await context.PostAsync(message);
        context.Wait(MessageReceived);
    }
}

这看起来像是我能找到的示例代码中使用lusimodel的方式,所以我不确定为什么它在这里不起作用。我只是想学习c语言,所以我有点迷茫。

你可能错过了你的类声明

试一试


使用LUIS模型的类声明作为@nuclear的答案。在您的代码中,该类声明已丢失。谢谢,我想已经修复了。请考虑接受这个答案()
namespace MyBot
{
    [LuisModel("80ba6a3b-8f62-47e6-81d0-350211b85580", "9b593fab21d54a328c0b9aeb0a64138b")]
    public MyBotClass
    {
        [LuisIntent("")]
        public async Task None(IDialogContext context, LuisResult result)
        {
            string message = "I'm sorry I didn't understand. Try asking about your bill.";
            await context.PostAsync(message);
            context.Wait(MessageReceived);
        }

        [LuisIntent("NextInvoiceDate")]
        public async Task NextInvoiceDate(IDialogContext context, LuisResult result)
        {
            string message = "Your next payment will go out on the 17th of the month.";
            await context.PostAsync(message);
            context.Wait(MessageReceived);
        }
    }
}