Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuget pack csproj ('new style') does not include dependencies in resulting .nuspec #7352

Closed
gparlakov opened this issue Oct 2, 2018 · 6 comments
Labels
Functionality:Pack Product:NuGet.exe NuGet.exe Resolution:Duplicate This issue appears to be a Duplicate of another issue

Comments

@gparlakov
Copy link

When packaging a csproj (the 'new' type generated by vs 2017 or dotnet cli - i.e. dotnet new classlib) the nuget packages dependencies included in the csproj do not get included in resulting nuspec file inside the generated package
Using dotnet pack works as expected. Also does Visual Studio build package option. I.e. these both generate the correct nuspec with dependencies.

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
NuGet Version: 4.7.1.5393

dotnet.exe --version: 2.1.402

VS version (if appropriate):15.8.4

OS version: windows 7 version 6.1 build7601: Service Pack 1

Worked before? If so, with which NuGet version:
Not sure.

Detailed repro steps so we can see the same problem (windows style path used below)

  1. git clone https://github.com/gparlakov/nugetBug_depsDontGetIncluded

  2. nuget restore .\nugetBug_depsDontGetIncluded\nugetBug.lib\nugetBug.lib.csproj

  3. nuget pack nugetBug_depsDontGetIncluded\nugetBug.lib\nugetBug.lib.csproj -Build -outputDirectory ./output

  4. Read the nuget.lib.nuspec from output\nuget.lib.1.0.0.nupkg- the deps included in nuget.lib.csproj are missing
    image

Sample Project

https://github.com/gparlakov/nugetBug_depsDontGetIncluded

@dimmy-timmy
Copy link

Same behavior for me.
NuGet Version: 4.8.1.5435

dotnet pack works as expected

@npickett
Copy link

It appears from this post that nuget.exe pack currently doesn't support package reference based projects.

See #5979

@nkolev92
Copy link
Member

Duplicate of #4491.

Please follow that issue for further updates.

@nkolev92 nkolev92 added Resolution:Duplicate This issue appears to be a Duplicate of another issue Product:NuGet.exe NuGet.exe Functionality:Pack labels Jan 25, 2019
@edufur
Copy link

edufur commented Feb 6, 2019

It's funny. This problem keeps getting closed as "duplicate" and referenced to others that are actually DIFFERENT. This problem seems to be getting ignored.

@nkolev92
Copy link
Member

nkolev92 commented Feb 8, 2019

@edufur
The answer here is use dotnet.exe/targets packing to pack SDK based projects.

@Rzpeg
Copy link

Rzpeg commented May 10, 2019

@nkolev92 targets packing with msbuild incorrectly packs the versions for referenced projects.
#5979 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Product:NuGet.exe NuGet.exe Resolution:Duplicate This issue appears to be a Duplicate of another issue
Projects
None yet
Development

No branches or pull requests

6 participants