gpt4 book ai didi

c# - Microsoft Bot Framework : MissingMethodException when Microsoft. Bot.Connector 已更新

转载 作者:行者123 更新时间:2023-12-02 08:32:25 25 4
gpt4 key购买 nike

我想将主动学习添加到我的聊天机器人中,这需要 Microsoft.Bot.Builder.AI.QnA 4.3.2 及更高版本。目前,我的机器人对任何 Microsoft.Bot.Builder 或 Microsoft.Bot.Connector 包使用版本 4.2.2。要更新 Microsoft.Bot.Builder.AI.QnA,我还需要将 Microsoft.Bot.Builder 和 Microsoft.Bot.Connector 包更新为 >= 4.3.2。当我将 Microsoft.Bot.Connector 更新到任何高于 4.2.2 的版本时,当我尝试在 Bot Framework 模拟器中运行聊天机器人时,我在 VS 输出窗口中收到以下错误。

Microsoft.AspNetCore.Hosting.Internal.WebHost:Critical: Application startup exception

System.MissingMethodException: Method not found: 'Void Microsoft.Bot.Connector.OAuthClient.set_EmulateOAuthCards(Boolean)'.
at Microsoft.Bot.Builder.Integration.AspNet.Core.ApplicationBuilderExtensions.UseBotFramework(IApplicationBuilder applicationBuilder)
at CBot.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in C:\Users\X\Desktop\CBot\Startup.cs:line 136
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

我相信当我调用 .UseBotFramework() 时发生异常:

    129   public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
130 {
131 _loggerFactory = loggerFactory;
132
133 app.UseDefaultFiles()
134 .UseStaticFiles()
135 .UseBotFramework();
136 }

我在Microsoft.Bot.Connector documentation中看到过那里现在是 OAuthClientOld 类以及 OAuthClient 类。 OAuthClientOld 类具有 EmulateOAuthCards 属性,但 OAuthClient 类没有,因此可能在 Microsoft.Bot.Connector 4.2.2 之后发生了变化。但鉴于我不直接调用 OAuthClient,我不确定如何解决此问题。有人能解决这个问题吗?

最佳答案

确保您的所有 Bot 软件包均已升级至 4.3.2。

以下任何/所有:

Microsoft.Bot.Builder.Dialogs                   {4.3.2}         
Microsoft.Bot.Connector {4.3.2}
Microsoft.Bot.Schema {4.3.2}
Microsoft.Bot.Configuration {4.3.2}
Microsoft.Bot.Builder {4.3.2}
Microsoft.Bot.Builder.Integration.AspNet.Core {4.3.2}
Microsoft.Bot.Builder.Ai.QnA {4.3.2}

关于c# - Microsoft Bot Framework : MissingMethodException when Microsoft. Bot.Connector 已更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59631752/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com