0

I created a bot, using the Azure Bot Service and a dialog template.

Then, I downloaded the code:here zip file

Here's some of the code:

[Serializable]
public class BasicForm
{
  [Prompt("Hi! What is your {&}?")]
  public string Name { get; set; }

  [Prompt("Please select your favorite car type {||}")]
  public CarOptions Car { get; set; }

  [Prompt("Please select your favorite {&} {||}")]
  public ColorOptions Color { get; set; }

  public static IForm<BasicForm> BuildForm()
  {
    // Builds an IForm<T> based on BasicForm
    return new FormBuilder<BasicForm>().Build();
  }

  public static IFormDialog<BasicForm> BuildFormDialog(FormOptions options = FormOptions.PromptInStart)
  {
    // Generated a new FormDialog<T> based on IForm<BasicForm>
    return FormDialog.FromForm(BuildForm, options);
  }
}

But, when I open this solution in VS2015: I cannot get it to compile.

Can you help me to make a solution I download from the Azure Bot Service compile?

Eric Dahlvang
  • 8,252
  • 4
  • 29
  • 50
Admiral Land
  • 2,304
  • 7
  • 43
  • 81

1 Answers1

0

The first step is install Bot Framework template for Visual Studio: https://docs.botframework.com/en-us/downloads/

Next, what I would recommend to you is create a sample bot using this VS template, then just change the code with this one you've downloaded.

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • 1
    This is not correct. The bots created using the Azure Bot Service are in fact Function apps, and require visual studio tools for azure functions in order to compile and debug locally. See here: https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/ – Eric Dahlvang Mar 24 '17 at 19:26
  • 1
    When I was studying Bot Framework, I did what I`ve post above and it worked for me. – Thiago Custodio Mar 25 '17 at 04:12
  • Interesting ... I haven't tried that. Function Apps have npm dependencies and are hosted in an env more node.js based than most .NET C# applications. – Eric Dahlvang Mar 25 '17 at 05:32