Reputation: 91
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 ?
Upvotes: 9
Views: 39133
Reputation: 1
You should check all the parameters of your functions. In my case the issue was related to the body parameter that was declared as dynamic.
Upvotes: 0
Reputation: 1
I have tried a lot of things. But you should have .Net Core 3.1 Runtime
Upvotes: 0
Reputation: 11
In my case I had 2 function Apps having the same Function name in the FucntionNameAttribute. By changing the names my Error get resolved
Upvotes: 1
Reputation: 308
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.
Upvotes: 3
Reputation: 1655
What worked for me is:
be on your branch
git clean -xdf <-- this cleans the branch of all untracked files. So be careful and save and commit all your files first.
right click solution and clean
right click solution and rebuild
Upvotes: 0
Reputation: 984
In Visual Studio, when locally building .net core "azure functions" apps with Visual Studio, you get these errors post-build:
Severity Code Description Project File Line Suppression State
Error Metadata generation failed. MyProject.Api C:\Users\user\.nuget\packages\microsoft.net.sdk.functions\3.0.7\build\Microsoft.NET.Sdk.Functions.Build.targets 44
Error Stack overflow. MyProject.Api C:\Users\user\.nuget\packages\microsoft.net.sdk.functions\3.0.7\build\Microsoft.NET.Sdk.Functions.Build.targets 44
This is a very frustrating reoccurring build error and the app will not run via the Functions CLI tools.
You may try:
Note: This error does not happen in VS Code (for me), mainly because we run the explicit command: dotnet build
So what fixed it?
After install completes:
In the freshly installed Visual Studio instance, open your Functions App, build it, and press F5 (the app runs via the AzureFunctionsTools cli_x64.exe process):
Upvotes: 0
Reputation: 20067
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
Upvotes: 10