26

Some context:

I have 4 nuget packages with dependencies. They are all in pre-release mode, and they evolve from alpha to "stable" at their own pace. I want to be able to specify in the dependency definition that prereleases should be included, but when the "stable" version is available, it should update to the stable version.

In the NuGet Docs the rules for versioning are defining [ and ] to include the version number you specify and ( and ) to exlude the version number you specify.

Some examples on the impact of the versions in the nuspec file:

 <dependencies>
     <dependency id="MyComponent" version="1.2.0" />
 </dependencies>

==> This will install MyComponent 1.2.0 or higher. (not including prerelease 1.2.0-alpha)

 <dependencies>
     <dependency id="MyComponent" version="[1.2.0" />
 </dependencies>

==> This will install MyComponent 1.2.0 or higher. (not including prerelease 1.2.0-alpha)

 <dependencies>
     <dependency id="MyComponent" version="[1.2.0,2)" />
 </dependencies>

==> This will install MyComponent 1.2.0 until but not including version 2.0.0. (not including prerelease 1.2.0-alpha but includes prerelease 2.0.0-alpha)

Currently I set:

 <dependencies>
     <dependency id="MyComponent" version="(1.1.32767" />
 </dependencies>

But I find this a very ugly way and it does not really reflect the reality. (What if version 1.1.32767.1 exists?)

I would like to know how to specify that you wish to include prerelease versions in the minimum version?

4

1 に答える 1

16

注意すべき重要な点が 1 つあります。

プレリリースに応じて、作成されたパッケージ自体もプレリリースになります。

デフォルトでは、依存関係のバージョン範囲を定義するときにプレリリースが無視されるのは理にかなっています。これは、生成されるパッケージのバージョンが変更されるためです (どのバージョンを選択するかを知らなくても)。

理想的には、インストール中に依存関係のバージョン範囲をチェックするアルゴリズムは、使用されたパッケージがプレリリースかどうかのチェックを実行し、許可されたバージョン範囲内にプレリリースの依存関係を含めるか除外します。

これが現在当てはまるかどうかはわかりませんが、あなたの質問を見るとそうではないと思います。http://nuget.codeplex.comで機能リクエストを記録する (またはプル リクエストを送信する) ことをお勧めします。

于 2013-02-06T16:08:27.017 に答える