Azure Functions v4の .NET なプロジェクトでNuGetパッケージ更新したりしたら以下のエラーがでて実行できない場合があります。
A host error has occurred during startup operation 'xxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxx'.
Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 指定されたファイルが見つかりません。.
Value cannot be null. (Parameter 'provider')
特定バージョンだけな気がしますが、該当しそうなのは以下のIssueです。
- Azure Functions Core Tools 4 – Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly ‘System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ #3115
- Value cannot be null. (Parameter ‘provider’) #3139
なんだか釈然としませんが、対処方法としては以下のようにします。
- Microsoft .NET SDK を再インストールする。
- Azure Functions Core Tools の最新をインストール(再インストール)する。
一時的な問題だと思いますが、、(たまにこの手の問題に遭遇する)