question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet pack doesn't let me provide my own nuspec

See original GitHub issue

When I do “dotnet pack”, it synthesizes a .nuspec. This nuspec has several problems:

  • Authors and Owners isn’t right
  • requireLicenseAcceptance is wrong for my package
  • URLs to license and product and icon are wrong
  • It only has one dependency group on “.NETStandard”, but I wish to provide additional dependency groups so that UWP and .NET46 can consume my nuget package too

I wish to provide my own .nuspec file for it to use instead.

Expected behavior

If I do “dotnet pack” and my working directory already contains a .nuspec file, then it should use that.

Or: if I do “dotnet pack -h” then it should provide information on how to provide my own nuspec file.

Actual behavior

It doesn’t do either.

Environment data

dotnet --version output: 1.0.0-beta-002133 on OSX

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:22
  • Comments:34 (9 by maintainers)

github_iconTop GitHub Comments

36reactions
derekgreercommented, Apr 23, 2017

“dotnet-pack is going to be replaced by nuget pack” - https://github.com/dotnet/cli/issues/2893

And here I thought dotnet pack was intended to replace nuget pack. This tooling thrash is bonkers!

Okay, so as of April 23, 2017, should we be using nuget pack or dotnet nuget pack? If we use dotnet pack, is supporting separate nuspec files planned? Ultimately, I’m wondering how you’d go about specifying you’d like the spec to generate dependencies with ranges (e.g. <dependency id=“System.Logging” version=“[1,2)” />).

15reactions
plioicommented, Aug 18, 2017

You can use dotnet pack against a project, and that csproj can include <NuspecFile>relative path here</NuspecFile> within a <PropertyGroup>. In order to get the right version number information into the nuspec, though, I have to have a build script generate that nuspec. I think what’s really missing is for this scenario to support the old $replacementtoken$ syntax, propagating values from the new csproj packaging tags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack doesn't let me provide my own nuspec #5525
This nuspec has several problems: Authors and Owners isn't right; requireLicenseAcceptance is wrong for my package; URLs to license and product ...
Read more >
Pass variable to nuspec with dotnet pack
When using dotnet pack, how do I pass a variable to my nuspec file? I am trying to pass the version. Here is...
Read more >
dotnet pack command - .NET CLI
The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a...
Read more >
Create a package using the nuget.exe CLI
A detailed guide on designing and creating a NuGet package, including files and versioning.
Read more >
Dotnet pack - include referenced projects
One disadvantage of the nuspec approach is that you have to include package references in your nuspec file manually and that those package ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found