0

We've recently started using our own internal NuGet server to house packages that are common to many of our internal projects. Originally, every project we work on is versioned with the build date in the format:

[Year].[Month].[Day].[DailyBuildCount]

However, during our process to upgrade to .NET 4, we've decided to start versioning our packages with SemVer starting with v4.x. The problem is that NuGet treats the v4.x versions as OLDER than the ones versioned with the date format. In addition, projects referencing the v4.x versions think they need to upgrade to the versions with the date format, which aren't even targeting the same framework version.

Is there some way to configure NuGet such that package upgrades can't cross these versioning lines?

For inter-package dependencies, we have configured them with specific version dependencies such that dependencies themselves work OK. It's the main project reference that is the issue where "upgrades" may accidentally happen to an older version.

4

2 回答 2

1

副手,我认为你最好的选择是稍微重命名包。这将导致它们被视为完全独立的包并完全破坏版本链。

于 2013-08-29T17:39:47.403 回答
0

我有一系列的三篇博文可以帮助你:

最后一个链接显示了一个示例(在本例中为 jQuery,但可以应用于任何包),说明如何将版本强制为特定范围。这将确保当您发出 Update-Package 命令时,仅使用版本介于次要值和主要值之间的引用更新项目)。

但是,在您的情况下,最好的解决方案可能是像 Eric Lloyd 之前建议的那样,完全打破您的依赖链,以保持干净的依赖结构。

于 2014-01-27T13:42:36.460 回答