命名空间 'Microsoft.Bot.Builder' 中不存在类型或命名空间名称 'Dialogs'

The type or namespace name 'Dialogs' does not exist in the namespace 'Microsoft.Bot.Builder'

我正在使用 Microsoft Azure 在 .NET Framework C# 上构建一个聊天机器人,安装了所有参考资料,但是在更新到 Microsoft.Bot.Builder 4.0.7 之后,这个参考资料无法找到并显示此类错误:

Error CS0234 The type or namespace name 'Dialogs' does not exist in the namespace 'Microsoft.Bot.Builder' (are you missing an assembly reference?)

在 google 机器的帮助下,我认为您可能只需要

Microsoft.Bot.Builder.Dialogs

免责声明,在查找相关资源和文档后,我设法找到了 none 来显示可用的 SDK nugets

他们好像想保密

最后我发现,他们在 .net 标准和最新的 bot-package 更新方面遇到了问题。使用stable bot-package version 3.15.2,无需全部更新,只更新除bot相关参考之外的其他内容。问题即将解决。

您需要使用.NET Framework 版本>=4.6。 .net framework 为 4.5 时会出现此错误。 Microsoft.Bot.Builder 版本 3.8.0 使用它。

Microsoft.Bot.Builder 没有随附的对话框的特定包,即使它是相同的命名空间。您需要安装包 Microsoft.Bot.Builder.Dialogs linked here 并将其添加到您的 using 语句中。那应该可以消除您的错误。

使用包管理器 Install-Package Microsoft.Bot.Builder.Dialogs

使用 .NET CLI(对于 dotnet 核心) dotnet add package Microsoft.Bot.Builder.Dialogs