yotiky Tech Blog

とあるエンジニアの備忘録

Azure Functions を Visual Studio で発行する際に発生したエラーの解決方法

環境

問題1

Visual Studio で発行を実行すると以下のエラーが出て失敗する。(エラー内容はうろ覚え)

'Error generating extension metadata: System.IO.DirectoryNotFoundException: The path '[...]\bin\Debug\netcoreapp2.1\PubTmp\Out\bin' does not exist. Unable to generate Azure Functions extensions metadata file.

解決方法

NuGetで「Microsoft.NET.Sdk.Functions」を最新バージョンに更新する。

参考

dotnet publish fails with 'Metadata generation failed' sometimes · Issue #4055 · Azure/azure-functions-host · GitHub

問題2

上記解決方法実施後、以下のエラーが発生する。

The "UserAgentVersion" parameter is not supported by the "ZipDeployTask" task. Verify the parameter exists on the task, and it is a settable public instance property.

解決方法

Visual Studio を再起動する。

参考

Error publishing an V2 Azure Function from VS 2019