Workaround to fix the Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll error on Azure Functions v4
I am facing an issue with the Azure Functions build pipeline during migration to an isolated worker model. The error is:
Reason: File Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll is copied (via an MsBuild Copy task) to an unsupported output destination *\buildout\Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll. All files should be copied to a location under this project's output directory [*\objd\amd64\net8.0, *\bin\x64\Debug\net8.0] or one of the output roots [out, target, sig.pack].
This error is caused by the Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll
file, which is dynamically generated using Azure Functions Worker SDK in an isolated worker model. The local build is successful, but the pipeline build fails with buildcop errors. Could someone provide a workaround for this issue?