Skip to content

[Dotnet] ExtensionsMetadataGenerator targets "/bin" question #8428

@jefmeijvis

Description

@jefmeijvis

What language does your question apply to? (e.g. C#, JavaScript, Java, All)

C#

Question

When publishing an Azure Function from inside of Visual Studio 2022, I receive an error where the "..\obj\Release\net6.0\win-x86\PubTmp\Out" folder doesn't contain a bin subfolder.

I resolved this issue by doing the following:

The targets file for the ExtensionsMetadataGenerator specifies a target called "_GenerateFunctionsExtensionsMetadataPostPublish".
This target contains a GenerateFunctionsExtensionsMetadata with has a SourcePath and a OutputPath.

<GenerateFunctionsExtensionsMetadata SourcePath="$(PublishDir)bin" OutputPath="$(PublishDir)bin"/>

In my local Nuget package I was able to remove the "bin" part from the source and output path.
This resulted in the updated target:
<GenerateFunctionsExtensionsMetadata SourcePath="$(PublishDir)" OutputPath="$(PublishDir)"/>

File: azure-functions-host/tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/Targets/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets

This resolves my issue, and allows me to publish a Function to Azure from inside of visual studio.
Is there a known issue related to this? Because this workaround doesn't really seems to be a proper solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions