0

I wrote a C# web bot using external resources (.lg and .dialog files), which - as I think - are not deployed along with the code. I deploy from VS2019, right click and "publish / azure / Azure App Service (windows 10)" into an already existing app service.

Which are the worst that asks almost nothing, I cant see how I can add files to the publishment package. The bot wont work on azure portal, after several hours I found where are the log files, and see that it says cant open the .lg file because it is missing.

In the adaptive dialog constructor:

this.Generator = new TemplateEngineLanguageGenerator(Templates.ParseFile(Configuration["Dialog.Templates.Root"]));

in my appsettings.json:

"Dialog.Templates.Root": "Templates/root-dialog-templates.lg",

How can I add files to copy along during the deployment?

Thanks for any suggestion and help!

Zoltan Hernyak
  • 989
  • 1
  • 14
  • 35

1 Answers1

3

You can include something like this sample in your .csproj file, assuming your .lg, .dialog files are under the Dialogs folder

  <ItemGroup>
    <None Remove="Dialogs\**\*.lg" />
    <None Remove="Dialogs\**\*.dialog" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="Dialogs\**\*.lg">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Dialogs\**\*.dialog">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

This way you'll find the deployed files in the same folder relative to the project's content root, which is usually current directory.

Miguel Veloso
  • 1,055
  • 10
  • 16