-
Notifications
You must be signed in to change notification settings - Fork 255
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
The -IncludeReferencedProjects does not work in Nuget Version 4.1.0.2450 #5720
Comments
//cc |
@thejeff77
Does your dependent project have a nuspec file that has the same name as the project? Thanks! |
No. Since I'm building with Nuget 4, I'm making the assumption that building with .csproj files is the recommended approach. I'm also witnessing that the referenced project is in fact not being added as part of the package. Thanks for any additional help or fixes. |
@thejeff77 is this a NETCore project that you are trying to pack? |
Not entirely sure, but I can check tomorrow. Does that change things? |
yes. NuGet.exe doesn't really have support for packing NETCore projects. you should use dotnet.exe pack or msbuild /t:pack to pack a NETCore project. Also, for NETCore projects, any referenced projects are added as a package reference by design. We are, however, considering working on implementing support for adding referenced project's dll into the parent nupkg. |
Hmm, I'll give some of those a try. I'll try to add more context tomorrow for what I was trying to do, and let you know if its a NETCore project. PLEASE do that! If the nuget pack command could somehow put all of the files that end up in bin/<Debug|Release> into the package automatically that would be awesome. I think that is what this command is supposed to do... It has a sort of recursive nature to it.. |
I'm currently experiencing the same problem with a regular NET.4.5.2 project. So it appears this problem is NOT NETCore related. Any progress on this issue would be much appreciated. |
@basbossinkdivverence could you please attach a repro project for us to investigate? |
An example reproduction can be found here. |
Bump. Any update on this? |
I don't know if your question is directed to me but I've posted a link to a repository that reproduces this problem quite some time ago. The reproduction repository can be found here: https://github.com/basbossinkdivverence/nuget-5720-repro . |
@basbossinkdivverence this is because you have a project.json in your project. the presence of project.json/nuspec is seen as an indication that the project will be packed and shipepd as a nupkg. The -IncludeReferencedProject flag only really makes sense when your project is managing dependencies via packages.config file. Also note that project.json is now deprecated and i strongly urge you to make a move to PackageReference based csproj files. |
As you can see in the original post, nuget is creating the package from the csproj file which is the recommended approach for this version of nuget, and isn't related to project.json or packages.config per the reason you closed this post. Can you relate the reason for the original post to the reason you decided to close this defect? "Attempting to build package from 'FileSystemSDK.csproj'." |
So if we go the advocated route of PackageRef, we sacrifice automated package reference chaining? If so, that's a load of crap! |
Still waiting on this one. @rohit21agrawal you closed this as works as expected saying |
Looks like there are multiple reports. Guess this should have been closed as duplicate versus Works as expected. |
Details about Problem
The -IncludeReferencedProjects command doesn't work - it does not add the dependent DLLs into the nuget package. The detailed output lists the referenced projects under "dependencies" but doesn't pack them into the package. Any help or guidance is appreciated.
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
NuGet version (4.1.0.2450):
dotnet.exe --version (1.0.4):
VS version (15.2):
OS version (Win 10 V1703, Build 12063.483):
Worked before? If so, with which NuGet version:
Hasn't worked before
Detailed repro steps so we can see the same problem
Other suggested things
Verbose Logs
PM> nuget pack .\SDKs\FileSystem\FileSystemSDK\FileSystemSDK.csproj -IncludeReferencedProjects -Verbosity detailed
NuGet Version: 4.1.0.2450
Attempting to build package from 'FileSystemSDK.csproj'.
MSBuild auto-detection: using msbuild version '15.1.1012.6693' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Packing files from 'C:\HSAClients<redacted>\SDKs\FileSystem\FileSystemSDK\bin\Debug'.
Add file 'C:\HSAClients<redacted>\SDKs\FileSystem\FileSystemSDK\bin\Debug\FileSystemSDK.dll' to package as 'lib\dotnet5.0\FileSystemSDK.dll'
WARNING: Description was not specified. Using 'Description'.
Id: FileSystemSDK
Version: 1.0.0.0
Authors:
Description: Description
Dependencies: Microsoft.NETCore [5.0.0, ), Microsoft.NETCore.Portable.Compatibility [1.0.0, ), Newtonsoft.Json [9.0.1, ), NuGet.Build [2.12.0, ), NuGet.CommandLine [4.1.0, ), <**Referenced Project #**1> [1.0.0, ), <Referenced Project #2> [1.0.0, )
Added file '[Content_Types].xml'.
Added file '_rels/.rels'.
Added file 'FileSystemSDK.nuspec'.
Added file 'lib/dotnet5.0/FileSystemSDK.dll'.
Added file 'package/services/metadata/core-properties/26725b99ca7d4d6a9c49eea446210529.psmdcp'.
Successfully created package 'C:\HSAClients<Redacted>\FileSystemSDK.1.0.0.nupkg'.
PM>
Sample Project
Very helpful if you can zip a project and paste into this issue!
Upon request, it is a straightforward issue, hopefully you can do this yourself because I can't put my project in here.
The text was updated successfully, but these errors were encountered: