Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "Metadata generation failed" when building C# function app in Visual Studio 2019

Tags:

c#

azure

Starting with a C# function app created as a new project in VS2019 (16.4.1) and latest Azure libraries (Azure Functions and Web Jobs Tools 16.4.457.38025) from VS Installer, it fails to build every time.

C:\Users\myname\.nuget\packages\microsoft.net.sdk.functions\1.0.29\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : Metadata generation failed.

Has anyone else been able to get this to work ?

like image 801
Ed Bomke Avatar asked Dec 11 '19 23:12

Ed Bomke


2 Answers

To solve this issue, upgraded Microsoft.NET.Sdk.Functions to last version(3.0.1).And delete the netstandard1.0 folder:

"C:\Users\myname\.nuget\packages\microsoft.net.sdk.functions\1.0.29\build\netstandard1.0
like image 119
Joey Cai Avatar answered Nov 02 '22 05:11

Joey Cai


This error started occurring for me when I upgraded the "Microsoft.NET.Sdk.Functions" to 4.0.0 or above (unfortunately). Staying with 3.0.13 allows it to compile without error.

like image 3
TheTall Avatar answered Nov 02 '22 03:11

TheTall