Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How does nuget handle project references when publishing packages?

$
0
0

So for example lets say I have 2x csproj called A and B.

We have a project reference in B to A, so there are a few scenarios here and I cannot find information on how its handled:

Scenario 1 - Publish B when A isnt a published package

I assume in this case it would fail when trying to publish B because it cannot find a suitable dependency on nuget for A, although I am guessing here so clarification would be good.

Scenario 2 - Publish both packages independently

This is one of the more interesting scenarios, so lets say nothing has changed in A but we want to publish B, how does it translate the project reference from A to a nuget dependency on A? Does it just look for the latest build of A in nuget and add a dependency to that one?

Scenario 3 - Both packages are published together

This is one of the more common scenarios and in this case I can see that whenever you publish one package in the solution you also package new versions for everything else so their version numbers stay in line, this seems to create dependencies to all the same versions as expected here.


So scenario 1 and 2 are the main bits I am interested in as we started a discussion around if we should have project references vs package references between projects in the same solution, and if you are going to have package references to local projects it seems pointless, they may as well be in their own repo. So I just wanted to know how nuget handles the actual publishing so we can continue the debate with some facts around versioning etc.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>