question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors show up after adding a Blob trigger function on Azure Function V2 Project with "Microsoft.NET.Sdk.Functions" verison 1.0.21 : "Metadata generation failed.".

See original GitHub issue

With latest 15.9 preview:

  1. File > New Project > Azure Functions >Azure Functions v2 (.Net Core) with Empty template + Storage Emulator selected. 2.Open Manage Nuget Packages to update the “Microsoft.NET.Sdk.Functions” verison to 1.0.21
  2. Right click project -> Add New Item-> New Azure Function… 4.Select the Blob trigger function and set the connection to “AzureWebJobsStorage”.Click OK.
  3. Build.

Then, errors shows up in the error list.

ACTUAL function2

Severity Code Description Project File Line Suppression State
Error System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Azure.WebJobs, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.File name: ‘Microsoft.Azure.WebJobs, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType)   at System.Attribute.InternalParamGetCustomAttributes(ParameterInfo param, Type type, Boolean inherit)   at MakeFunctionJson.ParameterInfoExtensions.GetDisabledAttribute(ParameterInfo parameterInfo)   at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()   at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)   at MakeFunctionJson.MethodInfoExtensions.GetDisabled(MethodInfo method)   at MakeFunctionJson.MethodInfoExtensions.HasUnsuportedAttributes(MethodInfo method, String& error)   at MakeFunctionJson.FunctionJsonConverter.<GenerateFunctions>d__9.MoveNext()   at System.Collections.Generic.List1…ctor(IEnumerable1 collection)   at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)   at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()   at MakeFunctionJson.FunctionJsonConverter.TryRun()WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].Error generating functions metadata FunctionApp6 C:\Users\v-lingyx.nuget\packages\microsoft.net.sdk.functions\1.0.21\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets 39
Error Metadata generation failed. FunctionApp6 C:\Users\v-lingyx.nuget\packages\microsoft.net.sdk.functions\1.0.21\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets 39

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
jasonrmartincommented, Oct 19, 2018

I have the same issue. Switching back to Microsoft.NET.Sdk.Function v1.0.22 fixed for me.

1reaction
JohnReesoncommented, Dec 23, 2018

Should have been fixed in 1.0.24, issue can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting "Metadata generation failed" when building C# ...
Hi! I got the same error. But I'm failed when I typed "C:\Users\myname\.nuget\packages\microsoft.net.sdk.functions\1.0.29\build\netstandard1.0 .
Read more >
How to fix the below blob trigger and function app
Getting the below error when I trigger function app when there is change in the blob. Any idea what is the issue.
Read more >
Azure Functions quit building with error after upgrading ...
My Azure functions target x64 specifically due to some native dependencies. I have one that targets v1 (due to a Framework dependency) and ......
Read more >
Azure Blob storage trigger for Azure Functions
The following example shows a C# function that writes a log when a blob is added or updated in the samples-workitems container.
Read more >
i have created the function app using .net 5
i have created the function app using .net 5 and when i run the function app i get the above error as you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found