【问题标题】:Upgrading Microsoft.Bot.Builder.LanguageGeneration to 4.15.0 results in fromFile() error将 Microsoft.Bot.Builder.LanguageGeneration 升级到 4.15.0 会导致 fromFile() 错误
【发布时间】:2022-01-08 23:29:06
【问题描述】:

Microsoft.Bot.Builder.LanguageGeneration4.14.1 升级到4.15.0 会导致有关fromFile() 方法的新错误。在互联网上找不到任何解决方案或类似问题。这使我们无法升级,因此欢迎提供任何反馈。

/UnitTests/bin/Debug/net5.0/Resources/Lg/General.lg line 25:2 - line 25:39: Error occurred when parsing expression 'fromFile('../Cards/HelpCard.json')'. fromFile does not have an evaluator, it's not a built-in function or a custom function.

【问题讨论】:

    标签: botframework microsoft-teams nuget-package fromfile


    【解决方案1】:

    此版本引入了一个名为的全局标志 “Templates.EnableFromFile”表示是否自适应 LG 模板中允许使用表达式 fromFile 函数。如果 应用程序以前使用过这个功能,现在是 需要添加行“Templates.EnableFromFile = true;”到 Startup.cs 代码。

    来自botbuilder-dotnet/releases

    Startup.cs(或Program.cs)中添加它没有帮助。我不得不把它放在我使用 Templates 类的服务的构造函数中。

    【讨论】:

    • 能否确认您的问题是否已解决或仍在寻求帮助?
    • 由于某种原因,我无法在前 2 天选择自己的答案作为答案。我现在就做?
    猜你喜欢
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-07
    • 2021-05-14
    相关资源
    最近更新 更多