在本地机器上在哪里设置 Microsoft.Bot.Builder.Azure.Utils.GetAppSetting 的值?

Where to set Value for Microsoft.Bot.Builder.Azure.Utils.GetAppSetting on local machine?

我从 azure 的 bot 应用程序下载了示例代码,有一行我不确定配置值应该存储在哪里。我尽量不更改代码,因为稍后我需要发布回 Azure 服务器。所以对于这一行

var qnaKBId = Utils.GetAppSetting("QnAKnowledgebaseId");

当我需要在我的本地机器上编写代码时,我应该在哪里创建上面的变量?

我尝试在 web.config 中创建变量,但它变为空。 document 未指定任何细节。

在文档中,我们可以发现 Microsoft.Bot.Builder.Azure.Utils 是一个实用程序 class,用于 Azure 上的机器人 运行ning。

I tried create the variable in web.config but it getting null.

如果您想 运行 在本地使用您的机器人应用程序并从您的 web.config 文件访问设置,您可以使用以下代码片段在您的机器人应用程序中检索它。

var qnaKBId = ConfigurationManager.AppSettings["QnAKnowledgebaseId"];