Gratzy
Gratzy

Reputation: 2908

Publishing an Azure function returns "Publish has encountered an error" path \bin does not exist

I'm trying to publish my first test function to Azure functions. When I publish I get the error:

Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. 

A diagnostic log has been written to the following location:
"C:\Users\me\AppData\Local\Temp\tmp2C29.tmp"

The contest of that file say it was an unknown error, check the output log.

When I look at my output window I see this:

2>Unhandled Exception: System.IO.DirectoryNotFoundException: The path `D:\Dev\FunctionsTest-master\custom-binding\obj\Debug\netstandard2.0\PubTmp\Out\bin` does not exist. Unable to generate Azure Functions extensions metadata file.
2>   at ExtensionsMetadataGenerator.ExtensionsMetadataGenerator.Generate(String sourcePath, String outputPath, Action`1 logger) in D:\src\gh.fabiocav\azure-functions-host\tools\ExtensionsMetadataGenerator\src\ExtensionsMetadataGenerator.Console\ExtensionsMetadataGenerator.cs:line 25
2>   at ExtensionsMetadataGenerator.Console.Program.Main(String[] args) in D:\src\gh.fabiocav\azure-functions-host\tools\ExtensionsMetadataGenerator\src\ExtensionsMetadataGenerator.Console\Program.cs:line 28
2>Metadata generation failed.

I looked and the ...\PubTmp\Out\bin folder is not where it's being compiled. The actual folder is \PubTmp\Out\ (one folder higher).

I don't see any way of changing the folder location, I tried under properties of the function - build, but that path is the top level; not the final path.

I also don't see any way of selecting where the publish is looking for the compiled functions to publish.

How do I get these locations to be the same for the publish to work?

Upvotes: 0

Views: 1659

Answers (1)

Gratzy
Gratzy

Reputation: 2908

It appears that this was a bug in Visual Studio 2019. Patching to the current version took care of it.

Upvotes: 1

Related Questions