Azure / Azure/Azure-Functions

Referencing v1 Functions SDK blocks NuGet package auto-gen

Open
#677 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Short version: if the v1 Functions SDK is referenced, VS will not auto-gen a NuGet package (I realize this is an unusual scenario...)

I started with a v1 Functions app, which means it targets `net461` but uses the newer SDK-format csproj file. Of course, Functions apps are really just class libraries under the hood. The project was used to build dependency injection capabilities which I wanted to package as a reusable library, so the end result didn't include any triggers, just classes for attributes and various WebJobs extensions.

However, when I turned on the Generate option on the Package property page, no packages are created when I build.

After some trial and error, it turns out this only happens when I reference `Microsoft.NET.Sdk.Functions` (currently v1.0.7). I created a new .NET Standard class library, edited the csproj to target `net461`, then referenced the individual packages that the SDK uses, added in all my classes again, and that _does_ also generate a NuGet package.

I'm guessing this is intentional (a normal Functions project would have no need for package output), but I figured I'd report it in case it's some sort of bug.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.