package dependency for package requiring -pre switch

Topics: General
Mar 11, 2013 at 11:46 PM
I have a package i need to include in my phone project targeted package where the package manager console command to install it currently requires use of the -pre switch.

Should I expect the following dependency reference to successfully install it successfully, e.g.
<dependency id="Microsoft.Bcl.Async" version="1.0.14-rc" />
</dependencies>

do i need to switch to an tools/Install.ps1 command for this case, e.g.

install-package Microsoft.Bcl.Async -pre -source https://nuget.org/api/v2/ -version 1.0.14-rc -projectname $project.Name
Mar 13, 2013 at 12:01 AM
Hi Roberto,

Your own package is going to need a prerelease version number in order to have a prerelease dependency, and yes, if you're installing from PowerShell, that does obligate you to use the -pre switch when you install either your package or the dependency.

Having said that, there doesn't appear to be anything wrong with the syntax of your dependency reference above. If you're willing to let your package have a prerelease version number, it should work for you.

HTH,
Clay
Mar 13, 2013 at 12:20 AM
Thanks for the response.

q1 - Could you comment on what I specifically means for my package to change to using a prerelease version number, e.g. if my current version number is 1.6.0.2 do I now have to change it to something like 1.6.0.3-rc in order to release with a dependency on a package that is a prerelease package?

q2 - Is that a policy or something nuget.exe enforces at package generation or installation time when it sees a dependency package that has a pre-release version number?

q3 - are you confirming that the <dependency> element will install a prerelease version numbered package w/o any issues even though package manager console requires you to include a -pre switch setting to install it interactively?
Mar 13, 2013 at 12:33 AM
No problem. To get to the meat of your questions:
  1. Yes, we use Semantic Versioning to distinguish prerelease packages from stable ones. You should check out the NuGet docs' treatment of this topic at http://docs.nuget.org/docs/Reference/Versioning#Really_brief_introduction_to_SemVer to understand how we read the version number.
  2. We perform this check when running 'nuget pack'.
  3. That is the goal. File a bug if you run into any issues with this.
HTH,
Clay