Closed maartenba closed 4 years ago
I also need this, as I'm using macOS and really want to leverage the bot framework templates for my development. In the world of Data & A.I. where cross platform thrives, this would really make so much sense.
Hi @Maarten88 and @SamVanhoutte
I have moved this to the more appropriate repository and labled as an enhancement.
Also; just wanted to share that there is a Yeoman template you can use as well: npm install -g yo generator-botbuilder
We have those. :)
The Code upon which they are based is in Github.
The packages are all in Nuget. For example, here is the EchoBot template.
I've snipped a bit of the readme, and put it here.
# determine dotnet version
dotnet --version
# Installs all three templates (echo, core, empty)
dotnet new -i Microsoft.Bot.Framework.CSharp.EchoBot
dotnet new -i Microsoft.Bot.Framework.CSharp.CoreBot
dotnet new -i Microsoft.Bot.Framework.CSharp.EmptyBot
Verify the templates have been installed correctly by typing the following into your console:
dotnet new --list
Sample output from dotnet new --list
. Note: Version information for the templates may be different.
Templates Short Name Language Tags
----------------------------------------------------------------------------------------------------------------------------
Bot Framework Core Bot (v0.1.2) corebot [C#] Bot/Bot Framework/AI/Core Bot
Bot Framework Echo Bot (v0.1.2) echobot [C#] Bot/Bot Framework/AI/Echo Bot
Bot Framework Empty Bot (v0.1.2) emptybot [C#] Bot/Bot Framework/AI/Empty Bot
Console Application console [C#], F#, VB Common/Console
Class library classlib [C#], F#, VB Common/Library
Unit Test Project mstest [C#], F#, VB Test/MSTest
NUnit 3 Test Project nunit [C#], F#, VB Test/NUnit
NUnit 3 Test Item nunit-test [C#], F#, VB Test/NUnit
xUnit Test Project xunit [C#], F#, VB Test/xUnit
Razor Page page [C#] Web/ASP.NET
The above installation steps will install all three Bot Framework templates. If you prefer to install one template or a subset of the three templates, install them individually by following the steps below.
# Install EchoBot template
dotnet new -i Microsoft.Bot.Framework.CSharp.EchoBot
# Install CoreBot template
dotnet new -i Microsoft.Bot.Framework.CSharp.CoreBot
# Install EmptyBot template
dotnet new -i Microsoft.Bot.Framework.CSharp.EmptyBot
# Generate an Echo Bot
dotnet new echobot -n MyEchoBot
# Generate a Core Bot
dotnet new corebot -n MyCoreBot
# Generate a Core Bot
dotnet new corebot -n MyCoreBotWithTests --include-tests
# Generate an Empty Bot
dotnet new emptybot -n MyEmptyBot
To run your bot locally, type the following in your console:
# change into the project's folder. e.g. EchoBot
cd EchoBot
# run the bot
dotnet run
http://localhost:3978/api/messages
Once the Emulator is connected, you can interact with and receive messages from your bot.
It's often easier to develop the capabilities of your bot locally, and to use the Bot Framework Emulator to test your changes.
If you use the --include-tests
command line option when you generated a CoreBot. The CoreBot template will generate two projects CoreBot
and CoreBot.Test
. To run the CoreBot unit tests:
# build the CoreBot project
cd CoreBot
dotnet build
# build the CoreBot.Tests project
cd ../CoreBot.Tests
dotnet build
# run the unit tests
dotnet test
Please let me know if those aren't working correctly for you. They should be up-to-date and work correctly across PC, Mac, and Linux.
Perfect, thanks!
This is great! Thanks guys. Didn't see that before.
Right now, there are project templates available for Visual Studio (https://marketplace.visualstudio.com/items?itemName=BotBuilder.botbuilderv4).
While nice, these only work for Visual Studio and on Windows. To support macOS and Linux users, having
dotnet new
templates instead would be much appreciated.