Search code examples
c#azure-bot-serviceadaptive-cards

The type or namespace name 'AdaptiveCards' could not be found


I've tried both using Microsoft.AdaptiveCards; and using AdaptiveCards; but when I perform a build for my Azure Web App Bot I get the following error:

Dialogs\BasicLuisDialog.cs(17,7): error CS0246: The type or namespace name 'AdaptiveCards' could not be found (are you missing a using directive or an assembly reference?)

Any ideas?


Solution

  • Dale, you need to add a reference to the AdaptiveCard assembly file in your project's csproj file.

    Find the file 'Microsoft.Bot.Sample.LuisBot.csproj' and open it for editing. Find the section named 'ItemGroup' and add the following piece of code:

    <Reference Include="AdaptiveCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>packages\AdaptiveCards.1.0.3\lib\net452\AdaptiveCards.dll</HintPath>
    </Reference>
    

    You told your code file what assembly you needed but you haven't told the project where to find it.