4

I went to the Azure Portal to try out the Bot Framework. I followed the steps and created a Proactive bot.

Without changing anything, I went to Configure continuous integration and downloaded the zip file.

When I try to open that SLN file in Visual Studio 2015 I get the following error when opening the solution:

Popup error

The Output window shows this in the Solution dropdown:

Some of the properties associated with the solution could not be read.

Here's a screenshot of the Solution Explorer:

solution explorer

Then I press F5 to test it out...

running it

Is it supposed to be running? Am I supposed to do something?

Eric Dahlvang
  • 8,252
  • 4
  • 29
  • 50
Maxime Rouiller
  • 13,614
  • 9
  • 57
  • 107
  • 1
    same as http://stackoverflow.com/questions/42072650/why-cant-i-open-my-azure-bot-service-in-visual-studio?rq=1 ? (no answers there btw) – AakashM Mar 02 '17 at 15:16
  • 1
    same as http://stackoverflow.com/questions/41789201/can-i-modify-azure-bot-at-vs?rq=1 ? – AakashM Mar 02 '17 at 15:20
  • 1
    @AakashM Similar... but still not answered. I've pinged the devs on Twitter to try to answer this question. – Maxime Rouiller Mar 02 '17 at 17:21

1 Answers1

2

EDIT: Locally debugging Azure Function apps (which is the type of application created by the Bot Service) is somewhat complex at this time. The process is also undergoing changes between the Azure SDK 2.9.6 and 3.0. The tooling for VS2017 is also undergoing some changes: .NET Web Development and Tools Blog

Update 3-10-2017: This preview copy of Azure Functions Tools does not work with the newly released Azure SDK 3.0. If you want to continue using these tools on Visual Studio 2015, you will need to remain on the 2.9.6 SDK. Additionally, there are no Azure Function Tools currently available for Visual Studio 2017. We are actively working on the 2017 tools, and will provide an update in the next few weeks regarding our plans and strategy.


This blog post by Benjamin Perkins has a nice walk through: https://blogs.msdn.microsoft.com/benjaminperkins/2016/12/01/how-i-tested-my-chatbot-that-i-created-using-the-bot-services-on-azure/


There's also this : Debugging Bots Built using Azure Bot Service on Windows

The C# environment in Azure Bot Service has more in common with Node.js than a typical C# app because it requires a runtime host, much like the Node engine. In Azure, the runtime is part of the hosting environment in the cloud, but you’ll need to replicate that environment locally on your desktop.

First, you need to set up your environment. You’ll need:

  1. A local copy of your Azure Bot Service code (see Setting up Continuous Integration )
  2. The Bot Framework Emulator
  3. The Azure Functions CLI
  4. DotNet CLI

and if you want breakpoint debugging in Visual Studio 15:

  1. Visual Studio 15—the Community Edition will work fine
  2. The Command Task Runner Visual Studio Extension

After installing the tools above, you have everything you need to debug your C# bot locally.

Open a command prompt and navigate to the folder where your project.json file lives in your repository. Issue the command dotnet restore to restore the various packages referenced in your bot.

Note: Visual Studio 2017 RC is changing how it handles dependencies from a project.json to a .csproj model when loading in Visual Studio. As a result, you will need to download the csproj here: https://aka.ms/bf-debug-project and save the .csproj into your /repo/messages folder before running the dotnet restore command.

Note these are also requirements: Azure 2.9.6 .NET SDK
Visual Studio Tools for Azure Functions


And there's this: https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/ you will find a description of how to publish a function app from visual studio, and how to download and execute an existing function app in visual studio.

  1. Install the Azure Functions CLI from npm. If you’ve installed the Visual Studio Tools for Azure Functions, just add func.exe to your path from %USERPROFILE%\AppData\Local\Azure.Functions.Cli\1.0.0-beta.93 (or the latest version on your machine).

  2. Go to the Kudu console for your Function App in Function App Settings -> Kudu. Navigate to site and click on the download icon to the left of wwwroot (click on the animated gif below). Or, from an authenticated session, go to https://[YOURFUNCTIONAPP].scm.azurewebsites.net/api/zip/site/wwwroot/.

  3. Unzip the file wwwroot.zip on your local machine. From that directory, run the following:

func azure login
func azure functionapp list
func azure functionapp fetch-app-settings [name]

This will create a local file called appsettings.json. These settings are only used locally by the Functions CLI. Since this file contains secrets, be sure not to check this file in to source control! (The Azure Functions CLI adds appsettings.json to .gitignore for you.)

Copy your downloaded files to the web project folder (including appsettings.json). Include the script files and function.json in the project. F5 should now work and successfully attach a debugger.

Eric Dahlvang
  • 8,252
  • 4
  • 29
  • 50