Introduction
The Bot Framework Composer is a fantastic tool for creating/developing Microsoft bots, as it gives you the ability to sketch out and compose the whole simple and complex Bot applications within a visual interface instead of writing actual code. Composer to create the bot solution’s code and run it immediately to test it in the emulator and deploy it to Azure using the CLI. Bot developers should definitely check out this really awesome tool, as this will make your Bot development even easier in terms of building smart and engaging bots with ease. Just read this article to learn about setting up the Bot Framework composer.
Setup Bot Framework Composer
The Microsoft Bot Framework Composer is a Microsoft open source
GitHub project. You can clone the source code and start contributing to the development as well. It’s a web-based application, you can download and run the web application in local macine.
Run Bot Composer web application
You can wait some time for cloning the source code. After cloning the repo, open a commend prompt and navigate to the Bot Framework Composer folder and run the following commands for start the web application.
Step 1
Build and Run the Composer application yarn software is required.
Yarn is a package manager for code. It allows you to use and share code with other developers from around the world.
Step 2
Node JS is required for setup the application, so
download and install the Node JS application.
Step 3
Build and test the application. It's required to have Dot net core SDK,
Install Dotnet core 2.2++
Step 4
Download and install the Bot emulator for testing the application
Step 5
Once you have successfully installed all required software, we can start building and testing the composer. Open the Command prompt and switch to the “Composer” folder using cd <folder path>/Composer
Step 6
Install all the dependencies using “yarn install “ in the command prompt.
Step 7
Creating and optimized production build extensions and library using “yarn build “ in command prompt.
Step 8
Start the client and server using “yarn startall” in command prompt.
Step 9
Bot framework Composer hosted successfully, open a browser and navigate to the address (http://localhost:3000) after the message composer is running successfully.
Create a New Bot Composer Project
You can create new project or Microsoft provided example template with best practices and supporting components. Let's continue and select an existing composer template for a demo.
Step 1
Click on New or Select Example template and provide the Solutions Location, name and project description and start the Visual design.
Step 2
Start looking at the visual design, however, there's no need to design for now. The next article will explain how to manage and modify visual design.
Step 3
Click on “Start Bot”, it will take some time to build the solutions.
Step 4
You're now ready to start and test your bot. You will then see the Test in Emulator button show up. Click Test in Emulator and Bot Framework Emulator should start.
How to resolve the Build issue
You can easily resolve your build problem, if you are getting the error “You intended to execute a .NET Core program, but dotnet-bin/Debug/netcoreapp2.1/BotProject.dll does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.”, the output solution is not able to compile.
- Go the location of your generated bot (The one you set when creating a new bot, defaults to User Documents > Composer).
- Open command prompt “Run dotnet” build in your bot directory and see the errors.
- If you have Visual Studio, you can ignore step 2 and open your project in Visual Studio.
- The issue maybe ranges of sources for the build not to run. Wrongly configured Nuget sources, misaligned package version, just check and resolve yourself.
- Once the build succeeds, launch the bot via Composer again.
![Bot Framework Composer]()
Summary
You have successfully done the setup and built a bot application in the bot framework composer. I hope you have enjoyed learning. If you have any questions/feedback/issues, please write them in the comment box.