Dependency update before release using nuget

I am currently developing a set of libraries that are gradually adding additional features.

For example, in my solution, I have a Foo project that defines some basic set of functions, an additional Foo.Web project, for web implementations, and Foo.Web.Tokens for even more specific functions. Foo.Web.Tokens depends on Foo.Web , which depends on Foo .

I am trying to create separate nuget projects, so the user only needs to refer to the dependencies that they need. I run versions using GitVersionTask, so after assembly they all get the same version number, and I use the replacement tokens for nuget when creating from the project , so that all nuget packages have the same version number.

My problem is that when trying to link to the preliminary version, either Foo.Web or Foo.Web.Tokens nuget cannot resolve the dependency on Foo . If, for example, I published the package 1.1.0.0-alhpa0001 for each of the assemblies, when I try to update Foo.Web , nuget shows this error:

Install-Package : Unable to resolve dependency 'Foo (≥ 1.1.0.0)'.

Using the -Pre argument -Pre not change this. A Foo.1.1.0-alpha0001.nupkg exists, but I feel that nuget will not solve it, because it is not a stable version, and I allow nuget to automatically detect dependencies from the solution using the following command:

.\.nuget\NuGet.exe pack source/Foo.Web/Foo.Web.csproj -Build -Version 1.1.0.0-alpha0001 -symbols -IncludeReferencedProjects

How to properly resolve the link for the Foo.Web preerelease package of the Foo preerelease package of the same version?

+6
source share
1 answer

The IncludeReferencedProjects option seems to be pulling the version out of the reference project info.cs collection.

setting the AssemblyInformationalVersion attribute to the desired version of the nuget package seems to work the way you want.

for example, [assembly: AssemblyInformationalVersion("1.1.0-alpha0001")]

0
source

Source: https://habr.com/ru/post/978416/


All Articles