4

私の会社は現在、すべての共有アセンブリをパッケージ化するために nuget を使用しています。また、タグを使用して semver に基づいてバージョン管理を開始しました。

nuget が期待どおりに機能しない状況があります。

私は3つの共有アセンブリを持っています....

  • 列挙型
  • 一般
  • ビジネスの論理

パッケージ参照に関しては...

  • 共通 => 列挙型
  • BusinessLogic => Common、Enum

BusinessLogic が Common と Enum の両方に依存する理由は、Common の依存関係を更新 (および再構築、パッケージ化、公開) する必要がないためです。ビジネスの論理

それで、列挙型を追加して、それを BusinessLogic で使用したいと考えています。

これらは、私がそれを行う前のすべてのバージョンです...

  • 列挙型 = 1.4.0
  • 共通 = 1.2.1
  • ビジネスロジック = 2.0.1

BusinessLogic で使用したい新しい列挙型の値を Enum プロジェクトに追加し、ビルド、パッケージ化、公開します。

  • 列挙型 = 1.5.0
  • 共通 = 1.2.1
  • ビジネスロジック = 2.0.1

ここで、BusinessLogic、コミット、プッシュ、パッケージなどに変更を加えます...

  • 列挙型 = 1.5.0
  • 共通 = 1.2.1
  • ビジネスロジック = 2.1.0

したがって、依存関係は次のようになります...

  • 共通 => 列挙型 1.4.0
  • ビジネスロジック => 列挙型 1.5.0

今、私は走ります...

nuget pack BusinessLogic.csproj

私が期待するのは、nuget は Common が Enum の 1.4.0 を必要とすることを確認することですが、BusinessLogic は 1.5.0 を必要とするため、パッケージに依存関係を追加しますがEnum >= 1.5.0、Enum には依存関係がまったくありません。満たしてくれます。

この動作は設計によるものですか?

4

1 に答える 1

1

I agree with you that the current behavior is not correct. nuget tries to optimize the dependencies to keep them at a minimal set, but doesn't account for this case where the versions differ.

Could you please file a bug on http://nuget.codeplex.com/ so it shows up on the radar?

As a workaround for now, you should be able to add the dependency explicitly in the companion .nuspec file used to build the BusinessLogic package.

于 2011-07-19T18:11:01.523 に答える