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

Wrong paket ProjectRefences name causes incorrect packaging #1113

Closed
SavaNDragos opened this Issue Oct 6, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@SavaNDragos

I fond a pretty intereting issue when creating nuget packages:
In a proj file we can find the ProjectRefences (they resolve the dependencies between projects that are part of the same solution).
In case the project name we are refencing is different from the value that the projectreference has as a name, when paket creates the packages, it will do it wrong (it will include the assamblies for
referenced project also).
In the below example you can see ClassLibraryt.dll was included in the package because
ClassLibraryt is different from ClassLibrarytModified.csproj">

Example if we have:

{e6fef228-2b3b-451c-b7b6-1f309f24e2de}
ClassLibraryt

in our resulted packege we will have:
Mode LastWriteTime Length Name


----- 06/10/2015 10:30 4096 ClassLibraryt.dll
----- 06/10/2015 10:45 4608 ConsoleApplicationc.dll
----- 06/10/2015 10:45 11776 ConsoleApplicationc.pdb

Normally if we would have had

{e6fef228-2b3b-451c-b7b6-1f309f24e2de}
ClassLibrarytModified

the rsult would have been:
Mode LastWriteTime Length Name


----- 06/10/2015 10:31 4608 ConsoleApplicationc.dll
----- 06/10/2015 10:31 11776 ConsoleApplicationc.pdb

@SavaNDragos

This comment has been minimized.

Show comment
Hide comment
@SavaNDragos

SavaNDragos Oct 6, 2015

ProjectReference Include="..\ClassLibraryt\ClassLibrarytModified.csproj"
  Project {e6fef228-2b3b-451c-b7b6-1f309f24e2de} Project
  Name ClassLibraryt Name
ProjectReference

ProjectReference Include="..\ClassLibraryt\ClassLibrarytModified.csproj"
  Project {e6fef228-2b3b-451c-b7b6-1f309f24e2de} Project
  Name ClassLibrarytModified Name

ProjectReference

ProjectReference Include="..\ClassLibraryt\ClassLibrarytModified.csproj"
  Project {e6fef228-2b3b-451c-b7b6-1f309f24e2de} Project
  Name ClassLibraryt Name
ProjectReference

ProjectReference Include="..\ClassLibraryt\ClassLibrarytModified.csproj"
  Project {e6fef228-2b3b-451c-b7b6-1f309f24e2de} Project
  Name ClassLibrarytModified Name

ProjectReference

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Oct 6, 2015

Member

I'm not sure I understand the issue. can you try to put this into a repro.zip?

Member

forki commented Oct 6, 2015

I'm not sure I understand the issue. can you try to put this into a repro.zip?

@SavaNDragos

This comment has been minimized.

Show comment
Hide comment
@SavaNDragos

This comment has been minimized.

Show comment
Hide comment
@SavaNDragos

SavaNDragos Oct 6, 2015

Now if you run paket pack on this you will see 2 packages created, one of them (ConsoleApplicationc) will also contain the assamblies from the other one (which it is refered). The issues is caused because the ProjectReference Name is ClassLibraryt , but the project name ClassLibrarytModified (ClassLibrarytModified.csproj).
If you change the ProjectReference Name to ClassLibrarytModified in ConsoleApplicationc.csproj the packages will be published correctly (ConsoleApplicationc will no longer contain the asamblies for ClassLibrarytModified).

Now if you run paket pack on this you will see 2 packages created, one of them (ConsoleApplicationc) will also contain the assamblies from the other one (which it is refered). The issues is caused because the ProjectReference Name is ClassLibraryt , but the project name ClassLibrarytModified (ClassLibrarytModified.csproj).
If you change the ProjectReference Name to ClassLibrarytModified in ConsoleApplicationc.csproj the packages will be published correctly (ConsoleApplicationc will no longer contain the asamblies for ClassLibrarytModified).

@forki forki closed this in 6192424 Oct 7, 2015

forki added a commit that referenced this issue Oct 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment