BotBuilder-Samples
BotBuilder-Samples copied to clipboard
Address .NET Core 3.1 change around hostingModel default value
Sample information
- Sample type: \samples\
- Sample language: dotnetcore
- Sample name: All dotnetcore samples and generators
Describe the bug
In .NET Core 3.1, the hosting model default switched from "outofprocess"
to "inprocess"
which does not work with DL ASE (which uses "outofprocess"
). By having a mismatch for the hosting model, the two will never be able to talk to each other.
Per @DDEfromOR, this 3.1 breaking change also results in problems around deploying a DL Token server from the same App Service, so we should investigate and determine the best course of action.
[bug]
Migration docs: 2.2 -> 3.0
After speaking with @Jeffders and @johnataylor, the hostingModel change to "outofprocess"
would specifically target the Echo and Core bot samples and generators for .NET.
Edit: Along with the Web App Bot templates for Echo and Core bot.
To be explicit, there's a number of changes that need to be performed to make Echo and Core bot work out-of-the-box with minimal customer-driven changes.
Add logic to Startup.cs/index.js/ts to connect to the NamedPipe
- In Startup.cs, add the following:
app.UseNamedPipes(System.Environment.GetEnvironmentVariable("APPSETTING_WEBSITE_SITE_NAME") + ".directline");
- In index.js/ts add the following logic:
adapter.useNamedPipe(async (context) => {
await myBot.run(context);
},
process.env.APPSETTING_WEBSITE_SITE_NAME + '.directline'
);
.NET: Update hosting process
- For the samples/generators this is just updating the .csproj
- ABS Templates need the web.config updated
JS/TS: web.config for iisnode
- Complete https://github.com/microsoft/botframework-sdk/issues/6056 to update
az bot prepare-deploy
- Update ABS templates web.config
Add appropriate code comments and documentation links in the samples/generators
Samples don't necessarily ship directly in sync with our milestones, this work will likely happen after 4.11 is out the door.
ASP.NET Core 3.0 or later(Migration docs: 2.2 -> 3.0) apps hosting model default changed to the in-process hosting model to improve performance and simplify deployment.
To configure an app for out-of-process hosting, set the value of the <AspNetCoreHostingModel>
property to OutOfProcess
in the project file (.csproj):
<PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>