こんばんは。この記事ではAzure Bot Serviceに関するトラブルシューティングメモです。
さっそくまいります。
問題
Azure Bot Serviceで構築したボットにApplication Insightsを構成しようとパッケージ(Microsoft.Bot.Builder.Integration.ApplicationInsights.Core)を追加したところ、ビルドは通るのですがアプリ起動時に以下のエラーが出てしまいました。
System.MissingMethodException: 'Method not found: 'Void Microsoft.Bot.Connector.Authentication.PasswordServiceClientCredentialFactory
...
Bot Emulator側でも400エラーが返る状況に。
![](https://i0.wp.com/www.simpletraveler.jp/wp-content/uploads/2022/04/image-176.png?resize=728%2C417&ssl=1)
原因と解決方法
こちらのStack Overflowが参考になりました。
パッケージ間の互換性があっていないから、とのこと。
私の場合は、Microsoft.Bot.Builder.Integration.ApplicationInsights.Coreをバージョン4.16.0でインストールしたのに、関連するMicrosoft.Bot.Builder.DialogsとMicrosoft.Bot.Builder.Integration.AspNet.Coreのバージョンが4.14.x系で互換していないことが原因のようでした。
これら2つのバージョンをあげることで、エラーが解消しました!
![](https://i0.wp.com/www.simpletraveler.jp/wp-content/uploads/2022/04/image-175.png?resize=728%2C349&ssl=1)
![](https://i0.wp.com/www.simpletraveler.jp/wp-content/uploads/2022/04/image-177.png?resize=728%2C397&ssl=1)
あせった・・・けどエラー内容からはなかなか想像つかない原因でした・・Stack Overflowの議論に感謝。
同じ問題で詰まった方の参考になりましたら幸いです。
おしまい
コメントを残す