0

I have Azure Functions project with the following settings in .csproj file:

<IsPackable>true</IsPackable>
<PackageId>Product.Services.Subscriptions</PackageId>
<Version>1.0.0</Version>
<Authors>MyCompany</Authors>
<Company>MyCompany</Company>

When I do dotnet pack for it nothing happens (no .nupkg file creates). The output I see:

Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.

Do I do something wrong or how is it supposed to work?

Maksim Ramanovich
  • 581
  • 1
  • 6
  • 22

1 Answers1

2

Do I do something wrong or how is it supposed to work?

This is the design default in azure functions. The dotnet pack will not be able to package azure functions. The IsPackable property appears to be set to false by default, and even manually changing it would not help. The dotnet cli will not create.nupkg files for azure functions but it can create for other dotnet projects.

REFERENCES:

  1. .net core - How to create NuGet package for AzureFunctions V2
  2. Unable to generate nuget package when using nuget "Microsoft.NET.Sdk.Functions" in a library project
SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
  • Thanks for the explanation. I was actually able to generate a package using nuget CLI, but it seems to be impossible to expose function from a referenced package. I think it is a wrong decision to pack functions in general... – Maksim Ramanovich Nov 24 '21 at 15:01