The Bot Dispatch runner is an example how to use the Bot Dispatch CLI in a programmatic way.
- Automatic retrieval of the Dispatch CLI tool with npm
- References the closed source Dll's from the example project
- Runs the dispatch tool as new process
- supports runtime timeout
- supports async/await
- clone the directory
- dotnet build the solution
- check BotDispatch.NPM
- added all references with hints in the .csproj
- check BotDispatch.Function
- added all references in the csproj too, and additional path to the json
var workingDirectory = Path.Join(Path.GetTempPath(), "dispatch");
var dispatchRunner = new DispatchRunner(workingDirectory);
var result = await dispatchRunner.RunDispatchAsync("-h");BotDispatch.NPM has an additional build step to call npm and restore botdispatch npm package. As the target environment might not have node.js installed, the Dlls are copied to the output of the referenced project.