Azure Functions: [null] Metadata generation failed (Rider 2018.3.4) - Resolved
dotnet core 2.1 project with Azure Functions is failing with the errors below.
This seems to be a Rider config issue on this machine because:
- This project builds in Rider on another machine with the exact same version of Rider, core and SDKs
- On the failing machine, a "dotnet build" completes with no errors
Errors are:
Microsoft.NET.Sdk.Functions.Build.targets(41, 5): [null] Metadata generation failed.
Microsoft.NET.Sdk.Functions.Build.targets(41, 5): [null] System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
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
Please sign in to leave a comment.
This is the output from `dotnet build` on the same machine
As you can see, this succeeds and the functions can be deployed to Azure.
Huh... false alarm, of a kind...
Re this link, I added the following to the functions .csproj file:
So, that's great, but it still doesn't explain why the project built on Rider on another machine and could also be built on this machine from the command line.
Any thoughts, anyone?