NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

[Feature]: Allow suppressing of framework references in generated nuspec files #11681

Open AArnott opened 2 years ago

AArnott commented 2 years ago

NuGet Product(s) Involved

NuGet SDK

The Elevator Pitch

The SuppressDependenciesWhenPacking property already allows conveniently suppressing all package dependencies. But it still includes framework dependencies. There is no property to suppress framework dependencies.

I think it makes the most sense to suppress framework dependencies as well when this same property is set. But if there are backward compat concerns for some reason, please give us another msbuild property that will suppress these.

Additional Context and Details

NuGet itself finds this useful, and has a hack to accomplish it: https://github.com/NuGet/NuGet.Client/blob/2380e11075e50104862c499515a0d3e293a7774a/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj#L146

I myself have hacked it out in a few other repos as well.

nkolev92 commented 2 years ago

Team Triage: Marking as lower priority due to the low number of reports, but we're supportive of the overall change and would be happy to take a PR.

AArnott commented 2 years ago

Would you take a PR that simply honors the SuppressDependenciesWhenPacking property, or would you want to see a new one?

nkolev92 commented 2 years ago

There's more than 1000 usages in GitHub repos, and that gives me a pause saying we should reuse the same property.

FrameworkReference probably has the same concern. let's keep the separate for now.