botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

CS0234, "The Type or namespace name 'Models' does not exist

Open heywoodg opened this issue 10 years ago • 4 comments

Hello, I am trying to code a simple C# app that interfaces with LUIS. I have the following:

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 System.Threading.Tasks;
using Microsoft.Bot.Connector;
using Microsoft.Bot.Connector.Utilities;
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);
    }

    [LuisIntent("NextAmount")]
    public async Task NextAmount(IDialogContext context, LuisResult result)
    {
        string message = $"Your next amount is expected to be around £129.72.";
        await context.PostAsync(message);
        context.Wait(MessageReceived);
    }
}

When I try to run it though, I get an error, CS0234, "The Type or namespace name 'Models' does not exist in the namespace 'Microsoft.Bot.Builder.Luis' (are you missing an assembly reference?)

How do I troubleshoot that?

heywoodg avatar Jun 07 '16 15:06 heywoodg

Are you sure you are running the latest version of the BotBuilder? Luis.Models is definitely a part of it. We have tests and samples that use it. Reopen if that does not solve your issue.

chrimc62 avatar Jun 07 '16 18:06 chrimc62

Thanks, for the response, really appreciated.

I checked for an update, and updated to Microsoft.Bot.Builder v1.2.3. Microsoft.bot.connector is on v1.1.0. So the error has gone for Luis.model, but I now get CS0234 for Microsoft.Bot.Connector.Utilities. Not sure if that is progress!

heywoodg avatar Jun 07 '16 20:06 heywoodg

Microsoft.Bot.Connector.Utilities has been removed. Remove it from your using statements.

msft-shahins avatar Jun 07 '16 20:06 msft-shahins

Great. Thanks very much!

heywoodg avatar Jun 07 '16 20:06 heywoodg