创建 Nuget 包的最佳实践
Best practice for creating Nuget packages
我们希望通过 NuGet 包提供我们的产品 SDK。该产品由多个组件组成,其中一些组件相互依赖。
我们试图回答的问题是我们应该创建多少个 NuGet 包?每个组件一个?每个产品一个?是否有我们应该遵循的一般经验法则或最佳实践?
提前致谢!
NuGet 包通常应该是每个程序集一个。来自 NuGet FAQ
NuGet.org allows uploading packages up to 250MB. As a best practice,
we recommend uploading smaller packages that are < 1 MB and using
dependencies to link together packages. As a rule of thumb, packages
contain only one assembly to avoid collissions.
......
Dependencies are mostly static and never change. When fixing a bug in code, the dependencies may not have to be updated. If your
dependencies ship in the same package you end up reshipping the large
packages every time. By splitting NuGet packages into smaller chunks
(dependencies), upgrades are much more fine-grained for the end user
of the NuGet package.
我们希望通过 NuGet 包提供我们的产品 SDK。该产品由多个组件组成,其中一些组件相互依赖。 我们试图回答的问题是我们应该创建多少个 NuGet 包?每个组件一个?每个产品一个?是否有我们应该遵循的一般经验法则或最佳实践?
提前致谢!
NuGet 包通常应该是每个程序集一个。来自 NuGet FAQ
NuGet.org allows uploading packages up to 250MB. As a best practice, we recommend uploading smaller packages that are < 1 MB and using dependencies to link together packages. As a rule of thumb, packages contain only one assembly to avoid collissions.
......
Dependencies are mostly static and never change. When fixing a bug in code, the dependencies may not have to be updated. If your dependencies ship in the same package you end up reshipping the large packages every time. By splitting NuGet packages into smaller chunks (dependencies), upgrades are much more fine-grained for the end user of the NuGet package.