我正在使用最新的bot框架更新.我有两个问题.
我很好奇的第一件事就是初始设置我已经按照README.md的要求将botFilePath和botFileSecret输入到appsettings.json中.一旦我尝试在本地运行它,它似乎无法从appsettings.json读取.我查看了Configuration类变量,但无法弄清楚为什么它无法从我输入的键中获取值.这是代码片段 - 我几乎从https中复制了它: //github.com/Microsoft/BotBuilder-Samples/blob/master/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddBot<MultiTurnPromptsBot>(options =>
{
var secretKey = Configuration.GetSection("botFileSecret")?.Value;
var botFilePath = Configuration.GetSection("botFilePath")?.Value;
// Loads .bot configuration file and adds a singleton that your Bot can access through dependency injection.
var botConfig = BotConfiguration.Load(botFilePath, secretKey);
Run Code Online (Sandbox Code Playgroud)它失败了 BotConfiguration.Load(...) because botFilePath is null (NullException error).
secretKey和botFilePath从我appsettings.json文件直接进入机器人的代码,然后我得到一个新的错误:System.ArgumentException: 'EncryptedText is not properly formatted'失败在同一个地方.我在应用程序设置下从Azure门户获取了我的密码...我无法找到有关ArgumentException错误的任何信息.有人有什么建议吗?