8

Closed

includereferencedprojects -symbols doesn't add sources for referenced project

description

  1. classlibrary 1 references classlibrary2
  2. nuget pack -includereferencedprojects - symbols
Actual:
the generated package contains pdb for both the projects but contains sources for classlibrary1 only

Expected:
to have sources of all referenced project (it might be a perf overkill for a huge solution with multiple references)

file attachments

Closed Dec 20, 2013 at 5:27 PM by danliu
verified using the latest 2.8 VSIX. symbol package generated by following the repro steps is attached.

comments

feiling wrote Mar 18, 2013 at 11:52 PM

The cause is that the two projects have source files with the same name. Currently we don't know how to handle this case, so move this issue to 2.4.

As a temporary fix, I'll change nuget.exe so that options -includereferencedprojects and -symbols can't be used together.

jharkness wrote Jul 29, 2013 at 3:35 PM

We're trying to build a package for each project in our solution, each project has its own nuspec file. When we run nuget pack with -includeReferencedProjects and -symbols I would expect it to still work as only a single project's source files are to be included in the package.

Instead of just disabling the options from working together, a simple file name collision check would at least not interfere with people who don't have colliding file names.

lucasbfr wrote Aug 19, 2013 at 3:44 PM

That's a really annoying "fix", since it prevents many entreprise scenarios. :/

I hope it is really fixed soon.

karldodd wrote Aug 20, 2013 at 3:50 AM

It is really annoying to get a message like "nuget : Specifying both -IncludeReferencedProjects and -Symbols is not supported".

Please fix that. jharkness's work around given above sounds very promising. And it doesn't look difficult. Thanks.

jharkness wrote Aug 22, 2013 at 4:17 AM

It took me about 2 minutes to remove the code enforcing the exclusivity of these flags. The error case which inspired this "fix" was not an issue in our scenario so all worked out in the end.

feiling wrote Oct 23, 2013 at 4:15 AM

Fixed. https://nuget.codeplex.com/SourceControl/changeset/315580a9a97db5d155dd6cfb35aaaaf75653569c

When -includereferencedprojects -symbols are both specified, the source files are added to the package with the project name as prefix. E.g. assume you have to projects p1 & p2. p1 references p2. Both projects contains just one file program.cs. When nuget.exe pack -includereferencedprojects -symbols is used to create a package, the sources files are added to the package as:
  • src\p1\program.cs
  • src\p2\program.cs

karldodd wrote Oct 23, 2013 at 6:08 AM

@feiling,

Great to hear that. Thanks for the fix.

Just to confirm its behavior, if both -includereferencedprojects -symbols specified, and the referenced project has a nuspec file (it is a package itself), dependencies will automatically be added to the package. Is that right?

danliu wrote Dec 20, 2013 at 5:27 PM

attach the generated symbol package.