7
votes

I'm currently develop a set of libraries that progressively add more features.

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

I'm attempting to build separate nuget projects so a user only needs to reference those dependencies they need. I'm versioning the assemblies with GitVersionTask, so after build, they all get the same version number and I'm using the replacement tokens for nuget when building from a project so that the nuget packages all have the same version number.

My problem is that when I try reference a prerelease version of either Foo.Web or Foo.Web.Tokens nuget is unable to resolve the dependency on Foo. If, for example, I have published a 1.1.0.0-alhpa0001 package for each of the assemblies, when I try and update Foo.Web, nuget shows this error:

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

Using the -Pre argument doesn't change this. A Foo.1.1.0-alpha0001.nupkg does exist but I feel like nuget won't resolve it because it's not a stable version, and I'm letting nuget automatically detect the 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 do I properly allow the Foo.Web prerelease package reference the Foo prerelease package of the same version?

1
I was wondering if you solved this issue? If you did, I would love to hear about it.Stian Standahl

1 Answers

0
votes

The IncludeReferencedProjects option seems to pull the version from the assemblyinfo.cs of the referenced project.

setting the AssemblyInformationalVersion attribute to the desired nuget package version seems to work as you want it to.

eg [assembly: AssemblyInformationalVersion("1.1.0-alpha0001")]