BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

Address .NET Core 3.1 change around hostingModel default value

Open stevengum opened this issue 4 years ago • 4 comments

Sample information

  1. Sample type: \samples\
  2. Sample language: dotnetcore
  3. 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]

stevengum avatar Jun 23 '20 21:06 stevengum

Migration docs: 2.2 -> 3.0

stevengum avatar Jun 23 '20 21:06 stevengum

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.

stevengum avatar Sep 24 '20 17:09 stevengum

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

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

stevengum avatar Sep 29 '20 23:09 stevengum

Samples don't necessarily ship directly in sync with our milestones, this work will likely happen after 4.11 is out the door.

stevengum avatar Oct 15 '20 16:10 stevengum

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>

gandiddi avatar Apr 17 '24 11:04 gandiddi