How to get version from reference in NuProj?

118 views Asked by At

I've been trying NuProj and one thing I want to achieve is using a reference's version number as version for the generated NuGet package.

Let's say I have a solution with 2 projects: (1) a class library and (2) a NuGet package. I've added 1 as a reference to 2, and when I compile the solution, NuProj generates the package but with version 1.0.0 (manually defined in 2's properties) instead of getting it from 1's generated DLL's version.

My objective is to have NuProj get 1's generated DLL's version number and use it as version number for 2 (eg: if 1 has version number 1.0.32, I want 2's generated package to have the same version number).

The documentation says that if "[I] have an MSBuild Target that can determine what [the version number] should be" I can use that, but I don't know where to start.

0

There are 0 answers