Azure / Azure/azure-functions-host

VS publish fails with 'Metadata generation failed'

Open
#5,229 5 comments 0 reactions 1 assignee Claimed by @brettsam View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

I think i'm seeing something like these ...

https://github.com/Azure/azure-functions-host/issues/4055
https://github.com/Azure/azure-functions-host/issues/4578

Everything builds and runs fine locally.
Left a working deploy-able solution on Friday, came in this morning to fix something completely unrelated and it's unable to publish.

This is what my VS output window has to say about the matter ...

> 1>------ Build started: Project: Workflow, Configuration: Debug Any CPU ------
> 1>Workflow -> D:\tfs\clx\Dev\v3\Workflow\bin\Debug\netcoreapp2.2\bin\Workflow.dll
> 2>------ Publish started: Project: Workflow, Configuration: Debug Any CPU ------
> 2>Restore completed in 893.78 ms for D:\tfs\clx\Dev\v3\Core.Objects\Core.Objects.csproj.
> 2>Restore completed in 893.07 ms for D:\tfs\clx\Dev\v3\Workflow\Workflow.csproj.
> 2>Restore completed in 893.31 ms for D:\tfs\clx\Dev\v3\Core.B2B.Objects\Core.B2B.Objects.csproj.
> 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702,2008 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:TRACE;DEBUG;NETCOREAPP;NETCOREAPP2_2 /errorendlocation /preferreduilang:en-US /reference: ...
> 2>Workflow -> D:\tfs\clx\Dev\v3\Workflow\bin\Debug\netcoreapp2.2\win-x86\bin\Workflow.dll
> 2>System.IO.FileLoadException: Could not load file or assembly 'Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
> 2> at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
> 2> at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
> 2> at System.Reflection.Assembly.LoadFrom(String assemblyFile)
> 2> at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
> 2> at MakeFunctionJson.FunctionJsonConverter.TryRun()
> 2>Error generating functions metadata
> 2>
> 2>Metadata generation failed.
> ========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========
> ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

Things I've tried ...
- Deleted my entire local copy of the repo, and all nuget packages.
- Flushed out VS temp files and rebooted the machine.
- Fetched solution, built and run the azure function locally to confirm it's all good.
- Right click > publish

I can confirm ...
- I'm running .Net Core 2.2 latest assemblies
- Latest .29 release of Azure Functions
- VS2019 fully patched.
- Problem only seems to be with the cloud deploy, everything else is fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.