Bot-docs: Could you add the steps to debug a bot using VS Code and C# ?

Created on 8 Apr 2020  Â·  7Comments  Â·  Source: MicrosoftDocs/bot-docs

I would like to debug my bot using VS Code rather than Visual Studio. I would love to see the steps listed down on this page.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

issue type new question writing customer

All 7 comments

Thanks for the suggestion @dipbanik. I added a section about debugging C# bots in PR 2163. The update should go live soon, here are the steps:

  1. Launch VS Code and open your bot project folder.
  2. Set breakpoints as necessary. You can set breakpoints by hovering your mouse over the column to the left of the line numbers. A small red dot will appear. If you click on the dot, the breakpoint is set. If you click the dot again, the breakpoint is removed.
  3. From the menu bar, click Run and then click Start Debugging. Your bot will start running in debugging mode from the Terminal in Visual Studio Code.
  4. Start the Bot Framework Emulator and connect to your bot as described in the Debug with the Bot Framework Emulator article.
  5. From the emulator, send your bot a message (for example, send the message "Hi"). Execution will stop at the line where you place the breakpoint.

@emgrol This is highly appreciated. I was also looking for some documentation on how to kickstart a bot template from scratch using VS code. Any reference document or steps to that?

@dipbanik Which language are you working with? You can run the commands in the Javascript or Python quickstart in VS Code; they'll end up creating an echo bot based on the template.

@emgrol I am interested in C# with VS Code. I can create new project in Visual Studio 2017 or 2019 but I would like to know if there is a way to do the same with VS Code using the C# language.

@dipbanik The instructions for how to create a C# bot in VS Code are in the Create a bot with the Bot Framework SDK for .NET article under the Visual Studio Code tab.

@emgrol I was able to run it while editing on VS Code and C# starting sometime in July I believe. Thanks for the doc! I'm sure it'll help a lot of people!

Thanks @dipbanik! Closing this issue now that all questions have been resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

v-kydela picture v-kydela  Â·  5Comments

amthomas46 picture amthomas46  Â·  4Comments

olucafont6 picture olucafont6  Â·  5Comments

hansmbakker picture hansmbakker  Â·  7Comments

SarahSexton picture SarahSexton  Â·  3Comments